mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-19 23:56:16 +00:00
Removed all dependencies on sigc++.
This commit is contained in:
@@ -41,10 +41,6 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
|
|||||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
|
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
|
||||||
LIBS="$PTHREAD_LIBS $CURSES_LIB $LIBS"
|
LIBS="$PTHREAD_LIBS $CURSES_LIB $LIBS"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(sigc, sigc++-2.0,
|
|
||||||
CXXFLAGS="$CXXFLAGS $sigc_CFLAGS";
|
|
||||||
LIBS="$LIBS $sigc_LIBS")
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES(libcurl, libcurl >= 7.15.4,
|
PKG_CHECK_MODULES(libcurl, libcurl >= 7.15.4,
|
||||||
CXXFLAGS="$CXXFLAGS $libcurl_CFLAGS";
|
CXXFLAGS="$CXXFLAGS $libcurl_CFLAGS";
|
||||||
LIBS="$LIBS $libcurl_LIBS")
|
LIBS="$LIBS $libcurl_LIBS")
|
||||||
|
|||||||
+1
-3
@@ -47,8 +47,6 @@
|
|||||||
#include <rak/regex.h>
|
#include <rak/regex.h>
|
||||||
#include <rak/path.h>
|
#include <rak/path.h>
|
||||||
#include <rak/string_manip.h>
|
#include <rak/string_manip.h>
|
||||||
#include <sigc++/adaptors/bind.h>
|
|
||||||
#include <sigc++/adaptors/hide.h>
|
|
||||||
#include <torrent/utils/resume.h>
|
#include <torrent/utils/resume.h>
|
||||||
#include <torrent/object.h>
|
#include <torrent/object.h>
|
||||||
#include <torrent/connection_manager.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.");
|
throw torrent::internal_error("Manager::set_hashing_view(...) received NULL or is already set.");
|
||||||
|
|
||||||
m_hashingView = v;
|
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
|
torrent::ThrottlePair
|
||||||
|
|||||||
+8
-2
@@ -138,12 +138,18 @@ struct view_downloads_filter : std::unary_function<Download*, bool> {
|
|||||||
const torrent::Object& m_command;
|
const torrent::Object& m_command;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void
|
void
|
||||||
View::emit_changed() {
|
View::emit_changed() {
|
||||||
priority_queue_erase(&taskScheduler, &m_delayChanged);
|
priority_queue_erase(&taskScheduler, &m_delayChanged);
|
||||||
priority_queue_insert(&taskScheduler, &m_delayChanged, cachedTime);
|
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() {
|
View::~View() {
|
||||||
if (m_name.empty())
|
if (m_name.empty())
|
||||||
return;
|
return;
|
||||||
@@ -171,7 +177,7 @@ View::initialize(const std::string& name) {
|
|||||||
m_focus = 0;
|
m_focus = 0;
|
||||||
|
|
||||||
set_last_changed(rak::timer());
|
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
|
void
|
||||||
|
|||||||
+9
-7
@@ -52,8 +52,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <rak/timer.h>
|
#include <rak/timer.h>
|
||||||
#include <sigc++/signal.h>
|
|
||||||
#include <torrent/object.h>
|
#include <torrent/object.h>
|
||||||
|
#include <tr1/functional>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
@@ -63,8 +63,9 @@ class Download;
|
|||||||
|
|
||||||
class View : private std::vector<Download*> {
|
class View : private std::vector<Download*> {
|
||||||
public:
|
public:
|
||||||
typedef std::vector<Download*> base_type;
|
typedef std::vector<Download*> base_type;
|
||||||
typedef sigc::signal0<void> signal_type;
|
typedef std::tr1::function<void ()> slot_void;
|
||||||
|
typedef std::list<slot_void> signal_void;
|
||||||
|
|
||||||
using base_type::iterator;
|
using base_type::iterator;
|
||||||
using base_type::const_iterator;
|
using base_type::const_iterator;
|
||||||
@@ -101,7 +102,7 @@ public:
|
|||||||
|
|
||||||
iterator focus() { return begin() + m_focus; }
|
iterator focus() { return begin() + m_focus; }
|
||||||
const_iterator focus() const { 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 insert(Download* download) { base_type::push_back(download); }
|
||||||
void erase(Download* download);
|
void erase(Download* download);
|
||||||
@@ -143,7 +144,7 @@ public:
|
|||||||
|
|
||||||
// Don't connect any slots until after initialize else it get's
|
// Don't connect any slots until after initialize else it get's
|
||||||
// triggered when adding the Download's in DownloadList.
|
// triggered when adding the Download's in DownloadList.
|
||||||
signal_type& signal_changed() { return m_signalChanged; }
|
signal_void& signal_changed() { return m_signal_changed; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
View(const View&);
|
View(const View&);
|
||||||
@@ -154,7 +155,8 @@ private:
|
|||||||
inline void insert_visible(Download* d);
|
inline void insert_visible(Download* d);
|
||||||
inline void erase_internal(iterator itr);
|
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(); }
|
size_type position(const_iterator itr) const { return itr - begin(); }
|
||||||
|
|
||||||
@@ -176,7 +178,7 @@ private:
|
|||||||
|
|
||||||
rak::timer m_lastChanged;
|
rak::timer m_lastChanged;
|
||||||
|
|
||||||
signal_type m_signalChanged;
|
signal_void m_signal_changed;
|
||||||
rak::priority_item m_delayChanged;
|
rak::priority_item m_delayChanged;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,18 +48,27 @@
|
|||||||
|
|
||||||
namespace display {
|
namespace display {
|
||||||
|
|
||||||
|
WindowDownloadList::WindowDownloadList() :
|
||||||
|
Window(new Canvas, 0, 120, 1, extent_full, extent_full),
|
||||||
|
m_view(NULL) {
|
||||||
|
}
|
||||||
|
|
||||||
WindowDownloadList::~WindowDownloadList() {
|
WindowDownloadList::~WindowDownloadList() {
|
||||||
m_connChanged.disconnect();
|
if (m_view != NULL)
|
||||||
|
m_view->signal_changed().erase(m_changed_itr);
|
||||||
|
|
||||||
|
m_view = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
WindowDownloadList::set_view(core::View* l) {
|
WindowDownloadList::set_view(core::View* l) {
|
||||||
|
if (m_view != NULL)
|
||||||
|
m_view->signal_changed().erase(m_changed_itr);
|
||||||
|
|
||||||
m_view = l;
|
m_view = l;
|
||||||
|
|
||||||
m_connChanged.disconnect();
|
|
||||||
|
|
||||||
if (m_view != NULL)
|
if (m_view != NULL)
|
||||||
m_connChanged = m_view->signal_changed().connect(sigc::mem_fun(*this, &Window::mark_dirty));
|
m_changed_itr = m_view->signal_changed().insert(m_view->signal_changed().begin(), std::tr1::bind(&Window::mark_dirty, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -37,23 +37,18 @@
|
|||||||
#ifndef RTORRENT_DISPLAY_WINDOW_DOWNLOAD_LIST_H
|
#ifndef RTORRENT_DISPLAY_WINDOW_DOWNLOAD_LIST_H
|
||||||
#define RTORRENT_DISPLAY_WINDOW_DOWNLOAD_LIST_H
|
#define RTORRENT_DISPLAY_WINDOW_DOWNLOAD_LIST_H
|
||||||
|
|
||||||
#include <sigc++/connection.h>
|
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
#include "core/download_list.h"
|
#include "core/download_list.h"
|
||||||
|
#include "core/view.h"
|
||||||
namespace core {
|
|
||||||
class View;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace display {
|
namespace display {
|
||||||
|
|
||||||
class WindowDownloadList : public Window {
|
class WindowDownloadList : public Window {
|
||||||
public:
|
public:
|
||||||
WindowDownloadList() :
|
typedef core::View::signal_void::iterator signal_void_itr;
|
||||||
Window(new Canvas, 0, 120, 1, extent_full, extent_full),
|
|
||||||
m_view(NULL) {}
|
WindowDownloadList();
|
||||||
~WindowDownloadList();
|
~WindowDownloadList();
|
||||||
|
|
||||||
virtual void redraw();
|
virtual void redraw();
|
||||||
@@ -63,7 +58,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
core::View* m_view;
|
core::View* m_view;
|
||||||
|
|
||||||
sigc::connection m_connChanged;
|
signal_void_itr m_changed_itr;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ PathInput::pressed(int key) {
|
|||||||
return TextInput::pressed(key);
|
return TextInput::pressed(key);
|
||||||
|
|
||||||
} else if (m_showNext) {
|
} else if (m_showNext) {
|
||||||
m_signalShowNext.emit();
|
for (signal_void::iterator itr = m_signal_show_next.begin(), last = m_signal_show_next.end(); itr != last; itr++)
|
||||||
|
(*itr)();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
receive_do_complete();
|
receive_do_complete();
|
||||||
@@ -101,7 +102,7 @@ PathInput::receive_do_complete() {
|
|||||||
|
|
||||||
std::for_each(dir.begin(), dir.end(), _transform_filename());
|
std::for_each(dir.begin(), dir.end(), _transform_filename());
|
||||||
|
|
||||||
Range r = find_incomplete(dir, str().substr(dirEnd, get_pos()));
|
range_type r = find_incomplete(dir, str().substr(dirEnd, get_pos()));
|
||||||
|
|
||||||
if (r.first == r.second)
|
if (r.first == r.second)
|
||||||
return; // Show some nice colors here.
|
return; // Show some nice colors here.
|
||||||
@@ -121,8 +122,10 @@ PathInput::receive_do_complete() {
|
|||||||
// Only emit if there are more than one option.
|
// Only emit if there are more than one option.
|
||||||
m_showNext = ++utils::Directory::iterator(r.first) != r.second;
|
m_showNext = ++utils::Directory::iterator(r.first) != r.second;
|
||||||
|
|
||||||
if (m_showNext)
|
if (m_showNext) {
|
||||||
m_signalShowRange.emit(r.first, r.second);
|
for (signal_itr_itr::iterator itr = m_signal_show_range.begin(), last = m_signal_show_range.end(); itr != last; itr++)
|
||||||
|
(*itr)(r.first, r.second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PathInput::size_type
|
PathInput::size_type
|
||||||
@@ -147,9 +150,9 @@ find_complete_not_compare(const utils::directory_entry& complete, const std::str
|
|||||||
return !complete.d_name.compare(0, base.size(), base);
|
return !complete.d_name.compare(0, base.size(), base);
|
||||||
}
|
}
|
||||||
|
|
||||||
PathInput::Range
|
PathInput::range_type
|
||||||
PathInput::find_incomplete(utils::Directory& d, const std::string& f) {
|
PathInput::find_incomplete(utils::Directory& d, const std::string& f) {
|
||||||
Range r;
|
range_type r;
|
||||||
|
|
||||||
r.first = std::find_if(d.begin(), d.end(), rak::bind2nd(std::ptr_fun(&find_complete_not_compare), f));
|
r.first = std::find_if(d.begin(), d.end(), rak::bind2nd(std::ptr_fun(&find_complete_not_compare), f));
|
||||||
r.second = std::find_if(r.first, d.end(), rak::bind2nd(std::ptr_fun(&find_complete_compare), f));
|
r.second = std::find_if(r.first, d.end(), rak::bind2nd(std::ptr_fun(&find_complete_compare), f));
|
||||||
|
|||||||
+14
-9
@@ -37,7 +37,8 @@
|
|||||||
#ifndef RTORRENT_INPUT_PATH_INPUT_H
|
#ifndef RTORRENT_INPUT_PATH_INPUT_H
|
||||||
#define RTORRENT_INPUT_PATH_INPUT_H
|
#define RTORRENT_INPUT_PATH_INPUT_H
|
||||||
|
|
||||||
#include <sigc++/signal.h>
|
#include <list>
|
||||||
|
#include <tr1/functional>
|
||||||
|
|
||||||
#include "utils/directory.h"
|
#include "utils/directory.h"
|
||||||
#include "text_input.h"
|
#include "text_input.h"
|
||||||
@@ -46,15 +47,19 @@ namespace input {
|
|||||||
|
|
||||||
class PathInput : public TextInput {
|
class PathInput : public TextInput {
|
||||||
public:
|
public:
|
||||||
typedef std::pair<utils::Directory::iterator, utils::Directory::iterator> Range;
|
typedef utils::Directory::iterator directory_itr;
|
||||||
typedef sigc::signal0<void> Signal;
|
typedef std::pair<directory_itr, directory_itr> range_type;
|
||||||
typedef sigc::signal2<void, utils::Directory::iterator, utils::Directory::iterator> SignalShowRange;
|
|
||||||
|
typedef std::tr1::function<void ()> slot_void;
|
||||||
|
typedef std::tr1::function<void (directory_itr, directory_itr)> slot_itr_itr;
|
||||||
|
typedef std::list<slot_void> signal_void;
|
||||||
|
typedef std::list<slot_itr_itr> signal_itr_itr;
|
||||||
|
|
||||||
PathInput();
|
PathInput();
|
||||||
virtual ~PathInput() {}
|
virtual ~PathInput() {}
|
||||||
|
|
||||||
Signal& signal_show_next() { return m_signalShowNext; }
|
signal_void& signal_show_next() { return m_signal_show_next; }
|
||||||
SignalShowRange& signal_show_range() { return m_signalShowRange; }
|
signal_itr_itr& signal_show_range() { return m_signal_show_range; }
|
||||||
|
|
||||||
virtual bool pressed(int key);
|
virtual bool pressed(int key);
|
||||||
|
|
||||||
@@ -62,12 +67,12 @@ private:
|
|||||||
void receive_do_complete();
|
void receive_do_complete();
|
||||||
|
|
||||||
size_type find_last_delim();
|
size_type find_last_delim();
|
||||||
Range find_incomplete(utils::Directory& d, const std::string& f);
|
range_type find_incomplete(utils::Directory& d, const std::string& f);
|
||||||
|
|
||||||
bool m_showNext;
|
bool m_showNext;
|
||||||
|
|
||||||
Signal m_signalShowNext;
|
signal_void m_signal_show_next;
|
||||||
SignalShowRange m_signalShowRange;
|
signal_itr_itr m_signal_show_range;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <torrent/peer/peer.h>
|
#include <torrent/peer/peer.h>
|
||||||
#include <sigc++/connection.h>
|
|
||||||
|
|
||||||
#include "display/manager.h"
|
#include "display/manager.h"
|
||||||
#include "utils/list_focus.h"
|
#include "utils/list_focus.h"
|
||||||
|
|||||||
@@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
#include <rak/functional.h>
|
#include <rak/functional.h>
|
||||||
#include <rak/string_manip.h>
|
#include <rak/string_manip.h>
|
||||||
#include <sigc++/adaptors/bind.h>
|
|
||||||
#include <sigc++/adaptors/hide.h>
|
|
||||||
#include <torrent/exceptions.h>
|
#include <torrent/exceptions.h>
|
||||||
#include <torrent/torrent.h>
|
#include <torrent/torrent.h>
|
||||||
#include <torrent/utils/log.h>
|
#include <torrent/utils/log.h>
|
||||||
@@ -270,11 +268,14 @@ DownloadList::receive_view_input(Input type) {
|
|||||||
|
|
||||||
ElementStringList* esl = dynamic_cast<ElementStringList*>(m_uiArray[DISPLAY_STRING_LIST]);
|
ElementStringList* esl = dynamic_cast<ElementStringList*>(m_uiArray[DISPLAY_STRING_LIST]);
|
||||||
|
|
||||||
input->signal_show_next().connect(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
|
input->signal_show_next().push_back(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
|
||||||
input->signal_show_next().connect(std::tr1::bind(&ElementStringList::next_screen, *esl));
|
input->signal_show_next().push_back(std::tr1::bind(&ElementStringList::next_screen, *esl));
|
||||||
|
|
||||||
input->signal_show_range().connect(sigc::hide(sigc::hide(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST))));
|
input->signal_show_range().push_back(std::tr1::bind(&DownloadList::activate_display, this, DISPLAY_STRING_LIST));
|
||||||
input->signal_show_range().connect(sigc::mem_fun(*esl, &ElementStringList::set_range_dirent<utils::Directory::iterator>));
|
input->signal_show_range().push_back(std::tr1::bind(&ElementStringList::set_range_dirent<utils::Directory::iterator>,
|
||||||
|
*esl,
|
||||||
|
std::tr1::placeholders::_1,
|
||||||
|
std::tr1::placeholders::_2));
|
||||||
|
|
||||||
input->bindings()['\n'] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
|
input->bindings()['\n'] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
|
||||||
input->bindings()[KEY_ENTER] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
|
input->bindings()[KEY_ENTER] = std::tr1::bind(&DownloadList::receive_exit_input, this, type);
|
||||||
|
|||||||
+35
-18
@@ -37,7 +37,7 @@
|
|||||||
#ifndef RTORRENT_UTILS_LIST_FOCUS_H
|
#ifndef RTORRENT_UTILS_LIST_FOCUS_H
|
||||||
#define RTORRENT_UTILS_LIST_FOCUS_H
|
#define RTORRENT_UTILS_LIST_FOCUS_H
|
||||||
|
|
||||||
#include <sigc++/signal.h>
|
#include <tr1/functional>
|
||||||
|
|
||||||
namespace utils {
|
namespace utils {
|
||||||
|
|
||||||
@@ -46,15 +46,18 @@ namespace utils {
|
|||||||
template <typename Base>
|
template <typename Base>
|
||||||
class ListFocus {
|
class ListFocus {
|
||||||
public:
|
public:
|
||||||
typedef typename Base::iterator iterator;
|
typedef Base base_type;
|
||||||
typedef typename Base::const_iterator const_iterator;
|
typedef std::tr1::function<void ()> slot_void;
|
||||||
typedef typename Base::reverse_iterator reverse_iterator;
|
typedef std::list<slot_void> signal_void;
|
||||||
typedef typename Base::const_reverse_iterator const_reverse_iterator;
|
|
||||||
|
|
||||||
typedef typename Base::value_type value_type;
|
typedef typename base_type::iterator iterator;
|
||||||
typedef sigc::signal0<void> Signal;
|
typedef typename base_type::const_iterator const_iterator;
|
||||||
|
typedef typename base_type::reverse_iterator reverse_iterator;
|
||||||
|
typedef typename base_type::const_reverse_iterator const_reverse_iterator;
|
||||||
|
|
||||||
ListFocus(Base* b = NULL) : m_base(b) { if (b) m_focus = b->end(); }
|
typedef typename base_type::value_type value_type;
|
||||||
|
|
||||||
|
ListFocus(base_type* b = NULL) : m_base(b) { if (b) m_focus = b->end(); }
|
||||||
|
|
||||||
// Convinience functions, would have added more through using, but
|
// Convinience functions, would have added more through using, but
|
||||||
// can't.
|
// can't.
|
||||||
@@ -64,10 +67,10 @@ public:
|
|||||||
reverse_iterator rend() { return m_base->rend(); }
|
reverse_iterator rend() { return m_base->rend(); }
|
||||||
|
|
||||||
// Don't do erase on this object without making sure focus is right.
|
// Don't do erase on this object without making sure focus is right.
|
||||||
Base& base() { return *m_base; }
|
base_type& base() { return *m_base; }
|
||||||
|
|
||||||
iterator get_focus() { return m_focus; }
|
iterator get_focus() { return m_focus; }
|
||||||
void set_focus(iterator itr) { m_focus = itr; m_signalChanged.emit(); }
|
void set_focus(iterator itr);
|
||||||
|
|
||||||
// These are looping increment/decrements.
|
// These are looping increment/decrements.
|
||||||
iterator inc_focus();
|
iterator inc_focus();
|
||||||
@@ -77,15 +80,24 @@ public:
|
|||||||
void remove(const value_type& v);
|
void remove(const value_type& v);
|
||||||
|
|
||||||
// Be careful with copying signals.
|
// Be careful with copying signals.
|
||||||
Signal& signal_changed() { return m_signalChanged; }
|
signal_void& signal_changed() { return m_signal_changed; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Base* m_base;
|
void emit_changed();
|
||||||
|
|
||||||
|
base_type* m_base;
|
||||||
iterator m_focus;
|
iterator m_focus;
|
||||||
|
|
||||||
Signal m_signalChanged;
|
signal_void m_signal_changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename Base>
|
||||||
|
void
|
||||||
|
ListFocus<Base>::set_focus(iterator itr) {
|
||||||
|
m_focus = itr;
|
||||||
|
emit_changed();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
typename ListFocus<Base>::iterator
|
typename ListFocus<Base>::iterator
|
||||||
ListFocus<Base>::inc_focus() {
|
ListFocus<Base>::inc_focus() {
|
||||||
@@ -94,8 +106,7 @@ ListFocus<Base>::inc_focus() {
|
|||||||
else
|
else
|
||||||
m_focus = begin();
|
m_focus = begin();
|
||||||
|
|
||||||
m_signalChanged.emit();
|
emit_changed();
|
||||||
|
|
||||||
return m_focus;
|
return m_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +118,7 @@ ListFocus<Base>::dec_focus() {
|
|||||||
else
|
else
|
||||||
m_focus = end();
|
m_focus = end();
|
||||||
|
|
||||||
m_signalChanged.emit();
|
emit_changed();
|
||||||
|
|
||||||
return m_focus;
|
return m_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +130,7 @@ ListFocus<Base>::erase(iterator itr) {
|
|||||||
else
|
else
|
||||||
return m_base->erase(itr);
|
return m_base->erase(itr);
|
||||||
|
|
||||||
m_signalChanged.emit();
|
emit_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
@@ -136,6 +146,13 @@ ListFocus<Base>::remove(const value_type& v) {
|
|||||||
++first;
|
++first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Base>
|
||||||
|
void
|
||||||
|
ListFocus<Base>::emit_changed() {
|
||||||
|
for (signal_void::iterator itr = m_signal_changed.begin(), last = m_signal_changed.end(); itr != last; itr++)
|
||||||
|
(*itr)();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user