From 56a7546f4642f2dbd194e4fc035913dc8dc72763 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 7 May 2011 14:13:37 +0000 Subject: [PATCH] * This should fix the leeching and seeding filter. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1226 e378c898-3ddf-0310-93e7-cc216c733640 --- src/command_ui.cc | 6 ++++++ src/core/view_manager.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/command_ui.cc b/src/command_ui.cc index 04c82dfb..5c00b4af 100644 --- a/src/command_ui.cc +++ b/src/command_ui.cc @@ -193,6 +193,10 @@ apply_not(rpc::target_type target, const torrent::Object& rawArgs) { if (rawArgs.is_dict_key()) result = as_boolean(rpc::commands.call_command(rawArgs.as_dict_key().c_str(), rawArgs.as_dict_obj(), target)); + // TODO: Thus we should clean this up... + else if (rawArgs.is_list() && !rawArgs.as_list().empty()) + return apply_not(target, rawArgs.as_list().front()); + else result = as_boolean(rawArgs); @@ -533,6 +537,8 @@ initialize_command_ui() { CMD2_ANY_STRING("view.size_not_visible", std::bind(&cmd_view_size_not_visible, std::placeholders::_2)); CMD2_ANY_STRING("view.persistent", std::bind(&cmd_view_persistent, std::placeholders::_2)); + CMD2_ANY_STRING_V("view.filter_all", std::bind(&core::View::filter, std::bind(&core::ViewManager::find_ptr_throw, control->view_manager(), std::placeholders::_2))); + CMD2_DL_STRING ("view.filter_download", std::bind(&cmd_view_filter_download, std::placeholders::_1, std::placeholders::_2)); CMD2_DL_STRING ("view.set_visible", std::bind(&cmd_view_set_visible, std::placeholders::_1, std::placeholders::_2)); CMD2_DL_STRING ("view.set_not_visible", std::bind(&cmd_view_set_not_visible, std::placeholders::_1, std::placeholders::_2)); diff --git a/src/core/view_manager.h b/src/core/view_manager.h index f3ba0ca7..11489a38 100644 --- a/src/core/view_manager.h +++ b/src/core/view_manager.h @@ -80,6 +80,7 @@ public: iterator find(const std::string& name); iterator find_throw(const std::string& name); + View* find_ptr_throw(const std::string& name) { return *find_throw(name); } // If View::last_changed() is less than 'timeout' seconds ago, don't // sort.