mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 06:39:23 +00:00
Removed all dependencies on sigc++.
This commit is contained in:
+1
-3
@@ -47,8 +47,6 @@
|
||||
#include <rak/regex.h>
|
||||
#include <rak/path.h>
|
||||
#include <rak/string_manip.h>
|
||||
#include <sigc++/adaptors/bind.h>
|
||||
#include <sigc++/adaptors/hide.h>
|
||||
#include <torrent/utils/resume.h>
|
||||
#include <torrent/object.h>
|
||||
#include <torrent/connection_manager.h>
|
||||
@@ -115,7 +113,7 @@ Manager::set_hashing_view(View* v) {
|
||||
throw torrent::internal_error("Manager::set_hashing_view(...) received NULL or is already set.");
|
||||
|
||||
m_hashingView = v;
|
||||
v->signal_changed().connect(sigc::mem_fun(this, &Manager::receive_hashing_changed));
|
||||
m_hashingView->signal_changed().push_back(std::tr1::bind(&Manager::receive_hashing_changed, this));
|
||||
}
|
||||
|
||||
torrent::ThrottlePair
|
||||
|
||||
+8
-2
@@ -138,12 +138,18 @@ struct view_downloads_filter : std::unary_function<Download*, bool> {
|
||||
const torrent::Object& m_command;
|
||||
};
|
||||
|
||||
inline void
|
||||
void
|
||||
View::emit_changed() {
|
||||
priority_queue_erase(&taskScheduler, &m_delayChanged);
|
||||
priority_queue_insert(&taskScheduler, &m_delayChanged, cachedTime);
|
||||
}
|
||||
|
||||
void
|
||||
View::emit_changed_now() {
|
||||
for (signal_void::iterator itr = m_signal_changed.begin(), last = m_signal_changed.end(); itr != last; itr++)
|
||||
(*itr)();
|
||||
}
|
||||
|
||||
View::~View() {
|
||||
if (m_name.empty())
|
||||
return;
|
||||
@@ -171,7 +177,7 @@ View::initialize(const std::string& name) {
|
||||
m_focus = 0;
|
||||
|
||||
set_last_changed(rak::timer());
|
||||
m_delayChanged.slot() = std::tr1::bind(&signal_type::operator(), &m_signalChanged);
|
||||
m_delayChanged.slot() = std::tr1::bind(&View::emit_changed_now, this);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+9
-7
@@ -52,8 +52,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <rak/timer.h>
|
||||
#include <sigc++/signal.h>
|
||||
#include <torrent/object.h>
|
||||
#include <tr1/functional>
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
@@ -63,8 +63,9 @@ class Download;
|
||||
|
||||
class View : private std::vector<Download*> {
|
||||
public:
|
||||
typedef std::vector<Download*> base_type;
|
||||
typedef sigc::signal0<void> signal_type;
|
||||
typedef std::vector<Download*> base_type;
|
||||
typedef std::tr1::function<void ()> slot_void;
|
||||
typedef std::list<slot_void> signal_void;
|
||||
|
||||
using base_type::iterator;
|
||||
using base_type::const_iterator;
|
||||
@@ -101,7 +102,7 @@ public:
|
||||
|
||||
iterator focus() { return begin() + m_focus; }
|
||||
const_iterator focus() const { return begin() + m_focus; }
|
||||
void set_focus(iterator itr) { m_focus = position(itr); m_signalChanged.emit(); }
|
||||
void set_focus(iterator itr) { m_focus = position(itr); emit_changed(); }
|
||||
|
||||
void insert(Download* download) { base_type::push_back(download); }
|
||||
void erase(Download* download);
|
||||
@@ -143,7 +144,7 @@ public:
|
||||
|
||||
// Don't connect any slots until after initialize else it get's
|
||||
// triggered when adding the Download's in DownloadList.
|
||||
signal_type& signal_changed() { return m_signalChanged; }
|
||||
signal_void& signal_changed() { return m_signal_changed; }
|
||||
|
||||
private:
|
||||
View(const View&);
|
||||
@@ -154,7 +155,8 @@ private:
|
||||
inline void insert_visible(Download* d);
|
||||
inline void erase_internal(iterator itr);
|
||||
|
||||
inline void emit_changed();
|
||||
void emit_changed();
|
||||
void emit_changed_now();
|
||||
|
||||
size_type position(const_iterator itr) const { return itr - begin(); }
|
||||
|
||||
@@ -176,7 +178,7 @@ private:
|
||||
|
||||
rak::timer m_lastChanged;
|
||||
|
||||
signal_type m_signalChanged;
|
||||
signal_void m_signal_changed;
|
||||
rak::priority_item m_delayChanged;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user