From c845863f30dd2292eb4b1688f892c2b414106904 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sun, 24 Apr 2011 11:17:33 +0000 Subject: [PATCH] * Moving ChokeManager to 'torrent/download/choke_queue.h' and cleaning up code. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1221 e378c898-3ddf-0310-93e7-cc216c733640 --- src/command_download.cc | 10 ++++++++++ src/core/download.h | 4 +++- src/ui/download.cc | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/command_download.cc b/src/command_download.cc index 5bc7190b..e9afab7b 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -742,6 +743,15 @@ initialize_command_download() { CMD2_DL ("d.priority_str", std::bind(&retrieve_d_priority_str, std::placeholders::_1)); CMD2_DL_VALUE_V ("d.priority.set", std::bind(&core::Download::set_priority, std::placeholders::_1, std::placeholders::_2)); + CMD2_DL ("d.group", std::bind(&torrent::resource_manager_entry::group, + std::bind(&torrent::ResourceManager::entry_at, torrent::resource_manager(), + std::bind(&core::Download::main, std::placeholders::_1)))); + CMD2_DL_VALUE_V ("d.group.set", std::bind(&torrent::ResourceManager::set_group, + torrent::resource_manager(), + std::bind(&torrent::ResourceManager::find_throw, torrent::resource_manager(), + std::bind(&core::Download::main, std::placeholders::_1)), + std::placeholders::_2)); + CMD2_DL ("d.initialize_logs", std::bind(&cmd_d_initialize_logs, std::placeholders::_1)); CMD2_DL_LIST ("f.multicall", std::bind(&f_multicall, std::placeholders::_1, std::placeholders::_2)); diff --git a/src/core/download.h b/src/core/download.h index d2f051f2..80498cf1 100644 --- a/src/core/download.h +++ b/src/core/download.h @@ -71,7 +71,9 @@ public: Download(download_type d); ~Download(); - const torrent::DownloadInfo* info() const { return m_download.info(); } + const torrent::DownloadInfo* info() const { return m_download.info(); } + + torrent::DownloadMain* main() { return m_download.main(); } bool is_open() const { return m_download.info()->is_open(); } bool is_active() const { return m_download.info()->is_active(); } diff --git a/src/ui/download.cc b/src/ui/download.cc index f09eeafb..ac703e74 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -177,7 +177,7 @@ Download::create_info() { element->push_back(""); element->push_column("Connection type:", te_command("d.connection_current=")); - element->push_column("Choke heuristic:", te_command("cat=$d.up.choke_heuristics=,\", \",$d.down.choke_heuristics=")); + element->push_column("Choke heuristic:", te_command("cat=(d.up.choke_heuristics),\", \",(d.down.choke_heuristics),\", \",(d.group)")); element->push_column("Safe sync:", te_command("if=$pieces.sync.always_safe=,yes,no")); element->push_column("Send buffer:", te_command("cat=$convert.kb=$network.send_buffer.size=,\" KB\"")); element->push_column("Receive buffer:", te_command("cat=$convert.kb=$network.receive_buffer.size=,\" KB\""));