From 73fb55ae42a03081a3ee607475caf3b10a23a308 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 17 Mar 2005 18:53:15 +0000 Subject: [PATCH] Prefixed ui element classes with Element. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@359 e378c898-3ddf-0310-93e7-cc216c733640 --- TODO | 1 + rak/algorithm.h | 7 ++- src/input/path_input.cc | 6 +- src/ui/Makefile.am | 20 +++--- src/ui/download.cc | 18 +++--- src/ui/download.h | 4 +- src/ui/{base_element.h => element_base.h} | 8 +-- src/ui/element_download_list.cc | 62 +++++++++++++++++++ src/ui/element_download_list.h | 57 +++++++++++++++++ src/ui/{file_list.cc => element_file_list.cc} | 30 ++++----- src/ui/{file_list.h => element_file_list.h} | 10 +-- src/ui/{peer_info.cc => element_peer_info.cc} | 12 ++-- src/ui/{peer_info.h => element_peer_info.h} | 10 +-- src/ui/{peer_list.cc => element_peer_list.cc} | 12 ++-- src/ui/{peer_list.h => element_peer_list.h} | 10 +-- ...racker_list.cc => element_tracker_list.cc} | 24 +++---- ...{tracker_list.h => element_tracker_list.h} | 10 +-- 17 files changed, 212 insertions(+), 89 deletions(-) rename src/ui/{base_element.h => element_base.h} (91%) create mode 100644 src/ui/element_download_list.cc create mode 100644 src/ui/element_download_list.h rename src/ui/{file_list.cc => element_file_list.cc} (69%) rename src/ui/{file_list.h => element_file_list.h} (88%) rename src/ui/{peer_info.cc => element_peer_info.cc} (76%) rename src/ui/{peer_info.h => element_peer_info.h} (86%) rename src/ui/{peer_list.cc => element_peer_list.cc} (76%) rename src/ui/{peer_list.h => element_peer_list.h} (86%) rename src/ui/{tracker_list.cc => element_tracker_list.cc} (66%) rename src/ui/{tracker_list.h => element_tracker_list.h} (87%) diff --git a/TODO b/TODO index 2af4a4d8..917647ac 100644 --- a/TODO +++ b/TODO @@ -22,3 +22,4 @@ Make accumulate return the value, no refs please... > - being able to delete not just the torrent file, but the files it > created from rtorrent. Like when you start a torrent, but it is too > slow or broken or for various reasons you don't want to download it. + \ No newline at end of file diff --git a/rak/algorithm.h b/rak/algorithm.h index 0af2f903..1375c7e3 100644 --- a/rak/algorithm.h +++ b/rak/algorithm.h @@ -75,9 +75,10 @@ advance_bidirectional(_InputIter __first, _InputIter __middle1, _InputIter __las return std::make_pair(__middle1, __middle2); } +template struct -string_starts_with : public std::binary_function { - bool operator () (const std::string& complete, const std::string& base) const { +compare_base : public std::binary_function<_Value, _Value, bool> { + bool operator () (const _Value& complete, const _Value& base) const { return !complete.compare(0, base.size(), base); } }; @@ -110,7 +111,7 @@ make_base(_InputIter __first, _InputIter __last) { typename std::iterator_traits<_InputIter>::difference_type __pos = count_base(__base.begin(), __base.end(), __first->begin(), __first->end()); - if (__pos < __base.size()) + if (__pos < (typename std::iterator_traits<_InputIter>::difference_type)__base.size()) __base.resize(__pos); } diff --git a/src/input/path_input.cc b/src/input/path_input.cc index cfb8a893..5076697b 100644 --- a/src/input/path_input.cc +++ b/src/input/path_input.cc @@ -60,7 +60,7 @@ PathInput::receive_do_complete() { if (r.first == r.second) return; // Show some nice colors here. - std::string base = make_base(r.first, r.second); + std::string base = rak::make_base(r.first, r.second); // Clear the path after the cursor to make this code cleaner. It's // not really nessesary to add the complexity just because someone @@ -89,8 +89,8 @@ PathInput::Range PathInput::find_incomplete(utils::Directory& d, const std::string& f) { Range r; - r.first = std::find_if(d.begin(), d.end(), std::bind2nd(string_starts_with(), f)); - r.second = std::find_if(r.first, d.end(), std::not1(std::bind2nd(string_starts_with(), f))); + r.first = std::find_if(d.begin(), d.end(), std::bind2nd(rak::compare_base(), f)); + r.second = std::find_if(r.first, d.end(), std::not1(std::bind2nd(rak::compare_base(), f))); return r; } diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am index 1b7df365..0e3d7062 100644 --- a/src/ui/Makefile.am +++ b/src/ui/Makefile.am @@ -7,15 +7,17 @@ libsub_ui_a_SOURCES = \ download.h \ download_list.cc \ download_list.h \ - file_list.cc \ - file_list.h \ - peer_info.cc \ - peer_info.h \ - peer_list.cc \ - peer_list.h \ + element_download_list.cc \ + element_download_list.h \ + element_file_list.cc \ + element_file_list.h \ + element_peer_info.cc \ + element_peer_info.h \ + element_peer_list.cc \ + element_peer_list.h \ + element_tracker_list.cc \ + element_tracker_list.h \ root.cc \ - root.h \ - tracker_list.cc \ - tracker_list.h + root.h INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir) diff --git a/src/ui/download.cc b/src/ui/download.cc index 10130774..a9a5463a 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -35,10 +35,10 @@ #include "control.h" #include "download.h" -#include "file_list.h" -#include "peer_info.h" -#include "peer_list.h" -#include "tracker_list.h" +#include "element_file_list.h" +#include "element_peer_info.h" +#include "element_peer_list.h" +#include "element_tracker_list.h" namespace ui { @@ -57,10 +57,10 @@ Download::Download(DPtr d, Control* c) : m_focus = m_peers.end(); - m_uiArray[DISPLAY_PEER_LIST] = new PeerList(d, &m_peers, &m_focus); - m_uiArray[DISPLAY_PEER_INFO] = new PeerInfo(d, &m_peers, &m_focus); - m_uiArray[DISPLAY_FILE_LIST] = new FileList(d); - m_uiArray[DISPLAY_TRACKER_LIST] = new TrackerList(d); + m_uiArray[DISPLAY_PEER_LIST] = new ElementPeerList(d, &m_peers, &m_focus); + m_uiArray[DISPLAY_PEER_INFO] = new ElementPeerInfo(d, &m_peers, &m_focus); + m_uiArray[DISPLAY_FILE_LIST] = new ElementFileList(d); + m_uiArray[DISPLAY_TRACKER_LIST] = new ElementTrackerList(d); bind_keys(); @@ -74,7 +74,7 @@ Download::~Download() { if (m_window != m_control->get_display().end()) throw std::logic_error("ui::Download::~Download() called on an active object"); - std::for_each(m_uiArray, m_uiArray + DISPLAY_MAX_SIZE, rak::call_delete()); + std::for_each(m_uiArray, m_uiArray + DISPLAY_MAX_SIZE, rak::call_delete()); delete m_windowTitle; delete m_windowDownloadStatus; diff --git a/src/ui/download.h b/src/ui/download.h index 82c490f7..b900e017 100644 --- a/src/ui/download.h +++ b/src/ui/download.h @@ -40,7 +40,7 @@ namespace core { namespace ui { class Control; -class BaseElement; +class ElementBase; class Download { public: @@ -100,7 +100,7 @@ private: Display m_state; - BaseElement* m_uiArray[DISPLAY_MAX_SIZE]; + ElementBase* m_uiArray[DISPLAY_MAX_SIZE]; WTitle* m_windowTitle; WDownloadStatus* m_windowDownloadStatus; diff --git a/src/ui/base_element.h b/src/ui/element_base.h similarity index 91% rename from src/ui/base_element.h rename to src/ui/element_base.h index 6c1fd4b4..9f0cae81 100644 --- a/src/ui/base_element.h +++ b/src/ui/element_base.h @@ -20,19 +20,19 @@ // Skomakerveien 33 // 3185 Skoppum, NORWAY -#ifndef RTORRENT_UI_BASE_ELEMENT_H -#define RTORRENT_UI_BASE_ELEMENT_H +#ifndef RTORRENT_UI_ELEMENT_BASE_H +#define RTORRENT_UI_ELEMENT_BASE_H #include "display/manager.h" #include "input/bindings.h" namespace ui { -class BaseElement { +class ElementBase { public: typedef display::Manager::iterator MItr; - virtual ~BaseElement() {} + virtual ~ElementBase() {} virtual void activate(Control* c, MItr mItr) = 0; virtual void disable(Control* c) = 0; diff --git a/src/ui/element_download_list.cc b/src/ui/element_download_list.cc new file mode 100644 index 00000000..aef37e08 --- /dev/null +++ b/src/ui/element_download_list.cc @@ -0,0 +1,62 @@ +// rTorrent - BitTorrent client +// Copyright (C) 2005, Jari Sundell +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Contact: Jari Sundell +// +// Skomakerveien 33 +// 3185 Skoppum, NORWAY + +#include "config.h" + +#include + +#include "display/window_peer_list.h" + +#include "control.h" +#include "element_download_list.h" + +namespace ui { + +ElementDownloadList::ElementDownloadList(DList* l, DList::iterator* f) : + m_window(NULL), + m_list(l), + m_focus(f) { + +} + +void +ElementDownloadList::activate(Control* c, MItr mItr) { + if (m_window != NULL) + throw std::logic_error("ui::ElementDownloadList::activate(...) called on an object in the wrong state"); + +// c->get_input().push_front(&m_bindings); + +// *mItr = m_window = new WDownloadList(m_download, m_list, m_focus); +} + +void +ElementDownloadList::disable(Control* c) { + if (m_window == NULL) + throw std::logic_error("ui::ElementDownloadList::disable(...) called on an object in the wrong state"); + +// c->get_input().erase(&m_bindings); + +// delete m_window; +// m_window = NULL; +} + +} diff --git a/src/ui/element_download_list.h b/src/ui/element_download_list.h new file mode 100644 index 00000000..46daf482 --- /dev/null +++ b/src/ui/element_download_list.h @@ -0,0 +1,57 @@ +// rTorrent - BitTorrent client +// Copyright (C) 2005, Jari Sundell +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Contact: Jari Sundell +// +// Skomakerveien 33 +// 3185 Skoppum, NORWAY + +#ifndef RTORRENT_UI_ELEMENT_DOWNLOAD_LIST_H +#define RTORRENT_UI_ELEMENT_DOWNLOAD_LIST_H + +#include "core/download_list.h" + +#include "element_base.h" + +namespace display { + class WindowDownloadList; +} + +namespace ui { + +class Control; + +class ElementDownloadList : public ElementBase { +public: + typedef display::WindowDownloadList WDownloadList; + typedef core::DownloadList DList; + + ElementDownloadList(DList* l, DList::iterator* f); + + void activate(Control* c, MItr mItr); + void disable(Control* c); + +private: + WDownloadList* m_window; + + DList* m_list; + DList::iterator* m_focus; +}; + +} + +#endif diff --git a/src/ui/file_list.cc b/src/ui/element_file_list.cc similarity index 69% rename from src/ui/file_list.cc rename to src/ui/element_file_list.cc index f54debc1..4176a157 100644 --- a/src/ui/file_list.cc +++ b/src/ui/element_file_list.cc @@ -27,24 +27,24 @@ #include "display/window_file_list.h" #include "control.h" -#include "file_list.h" +#include "element_file_list.h" namespace ui { -FileList::FileList(core::Download* d) : +ElementFileList::ElementFileList(core::Download* d) : m_download(d), m_window(NULL), m_focus(0) { - m_bindings[' '] = sigc::mem_fun(*this, &FileList::receive_priority); - m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &FileList::receive_next); - m_bindings[KEY_UP] = sigc::mem_fun(*this, &FileList::receive_prev); + m_bindings[' '] = sigc::mem_fun(*this, &ElementFileList::receive_priority); + m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &ElementFileList::receive_next); + m_bindings[KEY_UP] = sigc::mem_fun(*this, &ElementFileList::receive_prev); } void -FileList::activate(Control* c, MItr mItr) { +ElementFileList::activate(Control* c, MItr mItr) { if (m_window != NULL) - throw std::logic_error("ui::FileList::activate(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementFileList::activate(...) called on an object in the wrong state"); c->get_input().push_front(&m_bindings); @@ -52,9 +52,9 @@ FileList::activate(Control* c, MItr mItr) { } void -FileList::disable(Control* c) { +ElementFileList::disable(Control* c) { if (m_window == NULL) - throw std::logic_error("ui::FileList::disable(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementFileList::disable(...) called on an object in the wrong state"); c->get_input().erase(&m_bindings); @@ -63,9 +63,9 @@ FileList::disable(Control* c) { } void -FileList::receive_next() { +ElementFileList::receive_next() { if (m_window == NULL) - throw std::logic_error("ui::FileList::receive_next(...) called on a disabled object"); + throw std::logic_error("ui::ElementFileList::receive_next(...) called on a disabled object"); if (++m_focus >= m_download->get_download().get_entry_size()) m_focus = 0; @@ -74,9 +74,9 @@ FileList::receive_next() { } void -FileList::receive_prev() { +ElementFileList::receive_prev() { if (m_window == NULL) - throw std::logic_error("ui::FileList::receive_prev(...) called on a disabled object"); + throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object"); if (m_download->get_download().get_entry_size() == 0) return; @@ -90,9 +90,9 @@ FileList::receive_prev() { } void -FileList::receive_priority() { +ElementFileList::receive_priority() { if (m_window == NULL) - throw std::logic_error("ui::FileList::receive_prev(...) called on a disabled object"); + throw std::logic_error("ui::ElementFileList::receive_prev(...) called on a disabled object"); if (m_focus >= m_download->get_download().get_entry_size()) return; diff --git a/src/ui/file_list.h b/src/ui/element_file_list.h similarity index 88% rename from src/ui/file_list.h rename to src/ui/element_file_list.h index 39dff537..31468d85 100644 --- a/src/ui/file_list.h +++ b/src/ui/element_file_list.h @@ -20,12 +20,12 @@ // Skomakerveien 33 // 3185 Skoppum, NORWAY -#ifndef RTORRENT_UI_FILE_LIST_H -#define RTORRENT_UI_FILE_LIST_H +#ifndef RTORRENT_UI_ELEMENT_FILE_LIST_H +#define RTORRENT_UI_ELEMENT_FILE_LIST_H #include "core/download.h" -#include "base_element.h" +#include "element_base.h" namespace display { class WindowFileList; @@ -35,11 +35,11 @@ namespace ui { class Control; -class FileList : public BaseElement { +class ElementFileList : public ElementBase { public: typedef display::WindowFileList WFileList; - FileList(core::Download* d); + ElementFileList(core::Download* d); void activate(Control* c, MItr mItr); void disable(Control* c); diff --git a/src/ui/peer_info.cc b/src/ui/element_peer_info.cc similarity index 76% rename from src/ui/peer_info.cc rename to src/ui/element_peer_info.cc index 9b4fe1b0..1a8113f5 100644 --- a/src/ui/peer_info.cc +++ b/src/ui/element_peer_info.cc @@ -27,11 +27,11 @@ #include "display/window_peer_info.h" #include "control.h" -#include "peer_info.h" +#include "element_peer_info.h" namespace ui { -PeerInfo::PeerInfo(core::Download* d, PList* l, PList::iterator* f) : +ElementPeerInfo::ElementPeerInfo(core::Download* d, PList* l, PList::iterator* f) : m_download(d), m_window(NULL), m_list(l), @@ -40,9 +40,9 @@ PeerInfo::PeerInfo(core::Download* d, PList* l, PList::iterator* f) : } void -PeerInfo::activate(Control* c, MItr mItr) { +ElementPeerInfo::activate(Control* c, MItr mItr) { if (m_window != NULL) - throw std::logic_error("ui::PeerInfo::activate(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementPeerInfo::activate(...) called on an object in the wrong state"); c->get_input().push_front(&m_bindings); @@ -50,9 +50,9 @@ PeerInfo::activate(Control* c, MItr mItr) { } void -PeerInfo::disable(Control* c) { +ElementPeerInfo::disable(Control* c) { if (m_window == NULL) - throw std::logic_error("ui::PeerInfo::disable(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementPeerInfo::disable(...) called on an object in the wrong state"); c->get_input().erase(&m_bindings); diff --git a/src/ui/peer_info.h b/src/ui/element_peer_info.h similarity index 86% rename from src/ui/peer_info.h rename to src/ui/element_peer_info.h index d5f1f086..b5734031 100644 --- a/src/ui/peer_info.h +++ b/src/ui/element_peer_info.h @@ -20,12 +20,12 @@ // Skomakerveien 33 // 3185 Skoppum, NORWAY -#ifndef RTORRENT_UI_PEER_INFO_H -#define RTORRENT_UI_PEER_INFO_H +#ifndef RTORRENT_UI_ELEMENT_PEER_INFO_H +#define RTORRENT_UI_ELEMENT_PEER_INFO_H #include "core/download.h" -#include "base_element.h" +#include "element_base.h" namespace display { class WindowPeerInfo; @@ -35,12 +35,12 @@ namespace ui { class Control; -class PeerInfo : public BaseElement { +class ElementPeerInfo : public ElementBase { public: typedef display::WindowPeerInfo WPeerInfo; typedef std::list PList; - PeerInfo(core::Download* d, PList* l, PList::iterator* f); + ElementPeerInfo(core::Download* d, PList* l, PList::iterator* f); void activate(Control* c, MItr mItr); void disable(Control* c); diff --git a/src/ui/peer_list.cc b/src/ui/element_peer_list.cc similarity index 76% rename from src/ui/peer_list.cc rename to src/ui/element_peer_list.cc index aa6e9d8a..d0fcfb24 100644 --- a/src/ui/peer_list.cc +++ b/src/ui/element_peer_list.cc @@ -27,11 +27,11 @@ #include "display/window_peer_list.h" #include "control.h" -#include "peer_list.h" +#include "element_peer_list.h" namespace ui { -PeerList::PeerList(core::Download* d, PList* l, PList::iterator* f) : +ElementPeerList::ElementPeerList(core::Download* d, PList* l, PList::iterator* f) : m_download(d), m_window(NULL), m_list(l), @@ -40,9 +40,9 @@ PeerList::PeerList(core::Download* d, PList* l, PList::iterator* f) : } void -PeerList::activate(Control* c, MItr mItr) { +ElementPeerList::activate(Control* c, MItr mItr) { if (m_window != NULL) - throw std::logic_error("ui::PeerList::activate(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementPeerList::activate(...) called on an object in the wrong state"); c->get_input().push_front(&m_bindings); @@ -50,9 +50,9 @@ PeerList::activate(Control* c, MItr mItr) { } void -PeerList::disable(Control* c) { +ElementPeerList::disable(Control* c) { if (m_window == NULL) - throw std::logic_error("ui::PeerList::disable(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementPeerList::disable(...) called on an object in the wrong state"); c->get_input().erase(&m_bindings); diff --git a/src/ui/peer_list.h b/src/ui/element_peer_list.h similarity index 86% rename from src/ui/peer_list.h rename to src/ui/element_peer_list.h index 8b54ff1d..1d3c6419 100644 --- a/src/ui/peer_list.h +++ b/src/ui/element_peer_list.h @@ -20,12 +20,12 @@ // Skomakerveien 33 // 3185 Skoppum, NORWAY -#ifndef RTORRENT_UI_PEER_LIST_H -#define RTORRENT_UI_PEER_LIST_H +#ifndef RTORRENT_UI_ELEMENT_PEER_LIST_H +#define RTORRENT_UI_ELEMENT_PEER_LIST_H #include "core/download.h" -#include "base_element.h" +#include "element_base.h" namespace display { class WindowPeerList; @@ -35,12 +35,12 @@ namespace ui { class Control; -class PeerList : public BaseElement { +class ElementPeerList : public ElementBase { public: typedef display::WindowPeerList WPeerList; typedef std::list PList; - PeerList(core::Download* d, PList* l, PList::iterator* f); + ElementPeerList(core::Download* d, PList* l, PList::iterator* f); void activate(Control* c, MItr mItr); void disable(Control* c); diff --git a/src/ui/tracker_list.cc b/src/ui/element_tracker_list.cc similarity index 66% rename from src/ui/tracker_list.cc rename to src/ui/element_tracker_list.cc index 7df1e7f1..6e3fed04 100644 --- a/src/ui/tracker_list.cc +++ b/src/ui/element_tracker_list.cc @@ -27,23 +27,23 @@ #include "display/window_tracker_list.h" #include "control.h" -#include "tracker_list.h" +#include "element_tracker_list.h" namespace ui { -TrackerList::TrackerList(core::Download* d) : +ElementTrackerList::ElementTrackerList(core::Download* d) : m_download(d), m_window(NULL), m_focus(0) { - m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &TrackerList::receive_next); - m_bindings[KEY_UP] = sigc::mem_fun(*this, &TrackerList::receive_prev); + m_bindings[KEY_DOWN] = sigc::mem_fun(*this, &ElementTrackerList::receive_next); + m_bindings[KEY_UP] = sigc::mem_fun(*this, &ElementTrackerList::receive_prev); } void -TrackerList::activate(Control* c, MItr mItr) { +ElementTrackerList::activate(Control* c, MItr mItr) { if (m_window != NULL) - throw std::logic_error("ui::TrackerList::activate(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementTrackerList::activate(...) called on an object in the wrong state"); c->get_input().push_front(&m_bindings); @@ -51,9 +51,9 @@ TrackerList::activate(Control* c, MItr mItr) { } void -TrackerList::disable(Control* c) { +ElementTrackerList::disable(Control* c) { if (m_window == NULL) - throw std::logic_error("ui::TrackerList::disable(...) called on an object in the wrong state"); + throw std::logic_error("ui::ElementTrackerList::disable(...) called on an object in the wrong state"); c->get_input().erase(&m_bindings); @@ -62,9 +62,9 @@ TrackerList::disable(Control* c) { } void -TrackerList::receive_next() { +ElementTrackerList::receive_next() { if (m_window == NULL) - throw std::logic_error("ui::TrackerList::receive_next(...) called on a disabled object"); + throw std::logic_error("ui::ElementTrackerList::receive_next(...) called on a disabled object"); if (++m_focus >= m_download->get_download().get_tracker_size()) m_focus = 0; @@ -73,9 +73,9 @@ TrackerList::receive_next() { } void -TrackerList::receive_prev() { +ElementTrackerList::receive_prev() { if (m_window == NULL) - throw std::logic_error("ui::TrackerList::receive_prev(...) called on a disabled object"); + throw std::logic_error("ui::ElementTrackerList::receive_prev(...) called on a disabled object"); if (m_download->get_download().get_tracker_size() == 0) return; diff --git a/src/ui/tracker_list.h b/src/ui/element_tracker_list.h similarity index 87% rename from src/ui/tracker_list.h rename to src/ui/element_tracker_list.h index fbb5df6a..f6d23fd2 100644 --- a/src/ui/tracker_list.h +++ b/src/ui/element_tracker_list.h @@ -20,12 +20,12 @@ // Skomakerveien 33 // 3185 Skoppum, NORWAY -#ifndef RTORRENT_UI_TRACKER_LIST_H -#define RTORRENT_UI_TRACKER_LIST_H +#ifndef RTORRENT_UI_ELEMENT_TRACKER_LIST_H +#define RTORRENT_UI_ELEMENT_TRACKER_LIST_H #include "core/download.h" -#include "base_element.h" +#include "element_base.h" namespace display { class WindowTrackerList; @@ -35,11 +35,11 @@ namespace ui { class Control; -class TrackerList : public BaseElement { +class ElementTrackerList : public ElementBase { public: typedef display::WindowTrackerList WTrackerList; - TrackerList(core::Download* d); + ElementTrackerList(core::Download* d); void activate(Control* c, MItr mItr); void disable(Control* c);