* Replaced the old TrackerList API with the cleaned up

TrackerContainer code.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1005 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-11-08 16:33:51 +00:00
parent 4a2ae4d339
commit 04e6575e5d
9 changed files with 33 additions and 42 deletions
+7 -7
View File
@@ -103,7 +103,7 @@ ElementTrackerList::receive_disable() {
if (m_window == NULL)
throw torrent::internal_error("ui::ElementTrackerList::receive_disable(...) called on a disabled object");
torrent::Tracker* t = m_download->download()->tracker_list().get(m_focus);
torrent::Tracker* t = m_download->download()->tracker_list()->at(m_focus);
if (t->is_enabled())
t->disable();
@@ -118,7 +118,7 @@ ElementTrackerList::receive_next() {
if (m_window == NULL)
throw torrent::internal_error("ui::ElementTrackerList::receive_next(...) called on a disabled object");
if (++m_focus >= m_download->download()->tracker_list().size())
if (++m_focus >= m_download->download()->tracker_list()->size())
m_focus = 0;
m_window->mark_dirty();
@@ -129,13 +129,13 @@ ElementTrackerList::receive_prev() {
if (m_window == NULL)
throw torrent::internal_error("ui::ElementTrackerList::receive_prev(...) called on a disabled object");
if (m_download->download()->tracker_list().size() == 0)
if (m_download->download()->tracker_list()->size() == 0)
return;
if (m_focus != 0)
--m_focus;
else
m_focus = m_download->download()->tracker_list().size() - 1;
m_focus = m_download->download()->tracker_list()->size() - 1;
m_window->mark_dirty();
}
@@ -145,12 +145,12 @@ ElementTrackerList::receive_cycle_group() {
if (m_window == NULL)
throw torrent::internal_error("ui::ElementTrackerList::receive_group_cycle(...) called on a disabled object");
torrent::TrackerList tl = m_download->download()->tracker_list();
torrent::TrackerList* tl = m_download->tracker_list();
if (m_focus >= tl.size())
if (m_focus >= tl->size())
throw torrent::internal_error("ui::ElementTrackerList::receive_group_cycle(...) called with an invalid focus");
tl.cycle_group(tl.get(m_focus)->group());
tl->cycle_group(tl->at(m_focus)->group());
m_window->mark_dirty();
}