mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 11:12:31 +00:00
C++11 fixes.
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ Control::Control() :
|
||||
|
||||
m_inputStdin->slot_pressed(sigc::mem_fun(m_input, &input::Manager::pressed));
|
||||
|
||||
m_taskShutdown.set_slot(std::tr1::bind(&Control::handle_shutdown, this));
|
||||
m_taskShutdown.slot() = std::tr1::bind(&Control::handle_shutdown, this);
|
||||
|
||||
m_commandScheduler->set_slot_error_message(rak::mem_fn(m_core, &core::Manager::push_log_std));
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ CurlGet::start() {
|
||||
|
||||
// Normally libcurl should handle the timeout. But sometimes that doesn't
|
||||
// work right so we do a fallback timeout that just aborts the transfer.
|
||||
m_taskTimeout.set_slot(std::tr1::bind(&CurlGet::receive_timeout, this));
|
||||
m_taskTimeout.slot() = std::tr1::bind(&CurlGet::receive_timeout, this);
|
||||
priority_queue_erase(&taskScheduler, &m_taskTimeout);
|
||||
priority_queue_insert(&taskScheduler, &m_taskTimeout, cachedTime + rak::timer::from_seconds(m_timeout + 5));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ CurlStack::CurlStack() :
|
||||
m_ssl_verify_peer(true),
|
||||
m_dns_timeout(60) {
|
||||
|
||||
m_taskTimeout.set_slot(std::tr1::bind(&CurlStack::receive_timeout, this));
|
||||
m_taskTimeout.slot() = std::tr1::bind(&CurlStack::receive_timeout, this);
|
||||
|
||||
#if (LIBCURL_VERSION_NUM >= 0x071000)
|
||||
curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERDATA, this);
|
||||
|
||||
@@ -114,7 +114,7 @@ DhtManager::start_dht() {
|
||||
torrent::dht_manager()->start(port);
|
||||
torrent::dht_manager()->reset_statistics();
|
||||
|
||||
m_updateTimeout.set_slot(std::tr1::bind(&DhtManager::update, this));
|
||||
m_updateTimeout.slot() = std::tr1::bind(&DhtManager::update, this);
|
||||
priority_queue_insert(&taskScheduler, &m_updateTimeout, (cachedTime + rak::timer::from_seconds(60)).round_seconds());
|
||||
|
||||
m_dhtPrevCycle = 0;
|
||||
@@ -197,7 +197,7 @@ DhtManager::update() {
|
||||
break;
|
||||
|
||||
if (itr == end) {
|
||||
m_stopTimeout.set_slot(std::tr1::bind(&DhtManager::stop_dht, this));
|
||||
m_stopTimeout.slot() = std::tr1::bind(&DhtManager::stop_dht, this);
|
||||
priority_queue_insert(&taskScheduler, &m_stopTimeout, (cachedTime + rak::timer::from_seconds(15 * 60)).round_seconds());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ DownloadFactory::DownloadFactory(Manager* m) :
|
||||
m_printLog(true),
|
||||
m_isFile(false) {
|
||||
|
||||
m_taskLoad.set_slot(std::tr1::bind(&DownloadFactory::receive_load, this));
|
||||
m_taskCommit.set_slot(std::tr1::bind(&DownloadFactory::receive_commit, this));
|
||||
m_taskLoad.slot() = std::tr1::bind(&DownloadFactory::receive_load, this);
|
||||
m_taskCommit.slot() = std::tr1::bind(&DownloadFactory::receive_commit, this);
|
||||
|
||||
// m_variables["connection_leech"] = rpc::call_command_void("protocol.connection.leech");
|
||||
// m_variables["connection_seed"] = rpc::call_command_void("protocol.connection.seed");
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ View::initialize(const std::string& name) {
|
||||
m_focus = 0;
|
||||
|
||||
set_last_changed(rak::timer());
|
||||
m_delayChanged.set_slot(std::tr1::bind(&signal_type::operator(), &m_signalChanged));
|
||||
m_delayChanged.slot() = std::tr1::bind(&signal_type::operator(), &m_signalChanged);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace display {
|
||||
Manager::Manager() :
|
||||
m_forceRedraw(false) {
|
||||
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&Manager::receive_update, this));
|
||||
m_taskUpdate.slot() = std::tr1::bind(&Manager::receive_update, this);
|
||||
}
|
||||
|
||||
Manager::~Manager() {
|
||||
|
||||
@@ -59,7 +59,7 @@ Window::Window(Canvas* canvas, int flags, extent_type minWidth, extent_type minH
|
||||
m_maxWidth(maxWidth),
|
||||
m_maxHeight(maxHeight) {
|
||||
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&Window::redraw, this));
|
||||
m_taskUpdate.slot() = std::tr1::bind(&Window::redraw, this);
|
||||
}
|
||||
|
||||
Window::~Window() {
|
||||
|
||||
@@ -48,7 +48,7 @@ WindowLog::WindowLog(core::Log* l) :
|
||||
Window(new Canvas, 0, 0, 0, extent_full, extent_static),
|
||||
m_log(l) {
|
||||
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&WindowLog::receive_update, this)),
|
||||
m_taskUpdate.slot() = std::tr1::bind(&WindowLog::receive_update, this);
|
||||
|
||||
// We're trying out scheduled tasks instead.
|
||||
m_connUpdate = l->signal_update().connect(sigc::mem_fun(*this, &WindowLog::receive_update));
|
||||
|
||||
@@ -71,7 +71,7 @@ CommandScheduler::insert(const std::string& key) {
|
||||
delete *itr;
|
||||
|
||||
*itr = new CommandSchedulerItem(key);
|
||||
(*itr)->set_slot(std::tr1::bind(&CommandScheduler::call_item, this, *itr));
|
||||
(*itr)->slot() = std::tr1::bind(&CommandScheduler::call_item, this, *itr);
|
||||
|
||||
return itr;
|
||||
}
|
||||
|
||||
@@ -51,22 +51,22 @@ public:
|
||||
CommandSchedulerItem(const std::string& key) : m_key(key), m_interval(0) {}
|
||||
~CommandSchedulerItem();
|
||||
|
||||
bool is_queued() const { return m_task.is_queued(); }
|
||||
bool is_queued() const { return m_task.is_queued(); }
|
||||
|
||||
void enable(rak::timer t);
|
||||
void disable();
|
||||
|
||||
const std::string& key() const { return m_key; }
|
||||
torrent::Object& command() { return m_command; }
|
||||
const std::string& key() const { return m_key; }
|
||||
torrent::Object& command() { return m_command; }
|
||||
|
||||
// 'interval()' should in the future return some more dynamic values.
|
||||
uint32_t interval() const { return m_interval; }
|
||||
void set_interval(uint32_t v) { m_interval = v; }
|
||||
uint32_t interval() const { return m_interval; }
|
||||
void set_interval(uint32_t v) { m_interval = v; }
|
||||
|
||||
rak::timer time_scheduled() const { return m_timeScheduled; }
|
||||
rak::timer time_scheduled() const { return m_timeScheduled; }
|
||||
rak::timer next_time_scheduled() const;
|
||||
|
||||
void set_slot(const slot_void& s) { m_task.set_slot(s); }
|
||||
slot_void& slot() { return m_task.slot(); }
|
||||
|
||||
private:
|
||||
CommandSchedulerItem(const CommandSchedulerItem&);
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public:
|
||||
void throw_shutdown_exception() { throw torrent::shutdown_exception(); }
|
||||
|
||||
ThreadBase::ThreadBase() {
|
||||
m_taskShutdown.set_slot(rak::ptr_fn(&throw_shutdown_exception));
|
||||
m_taskShutdown.slot() = std::tr1::bind(&throw_shutdown_exception);
|
||||
|
||||
m_threadQueue = new thread_queue_hack;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "rpc/parse_commands.h"
|
||||
|
||||
ThreadWorker::ThreadWorker() {
|
||||
m_taskTouchLog.set_slot(std::tr1::bind(&ThreadWorker::task_touch_log, this));
|
||||
m_taskTouchLog.slot() = std::tr1::bind(&ThreadWorker::task_touch_log, this);
|
||||
}
|
||||
|
||||
ThreadWorker::~ThreadWorker() {
|
||||
|
||||
Reference in New Issue
Block a user