mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 05:32:31 +00:00
* Minor BSD portability fixes.
* Added torrent::TrackerList::{set_,}key() and made rtorrent save the
key between sessions.
* Added import option to the man page.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@665 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -61,25 +61,23 @@ WindowTrackerList::redraw() {
|
||||
m_canvas->erase();
|
||||
|
||||
int pos = 0;
|
||||
torrent::TrackerList* tl = m_download->tracker_list();
|
||||
|
||||
m_canvas->print( 2, pos, "Trackers:");
|
||||
|
||||
m_canvas->print(2, pos, "Trackers: [Key: %08x]", tl->key());
|
||||
++pos;
|
||||
|
||||
torrent::TrackerList tl = m_download->download()->tracker_list();
|
||||
|
||||
if (tl.size() == 0)
|
||||
if (tl->size() == 0)
|
||||
return;
|
||||
|
||||
if (*m_focus >= tl.size())
|
||||
if (*m_focus >= tl->size())
|
||||
throw std::logic_error("WindowTrackerList::redraw() called on an object with a bad focus value.");
|
||||
|
||||
typedef std::pair<unsigned int, unsigned int> Range;
|
||||
|
||||
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, tl.size(), (m_canvas->get_height() + 1) / 2);
|
||||
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, tl->size(), (m_canvas->get_height() + 1) / 2);
|
||||
|
||||
while (range.first != range.second) {
|
||||
torrent::Tracker t = tl.get(range.first);
|
||||
torrent::Tracker t = tl->get(range.first);
|
||||
|
||||
m_canvas->print(0, pos++, "%c %s",
|
||||
range.first == *m_focus ? '*' : ' ',
|
||||
@@ -89,7 +87,7 @@ WindowTrackerList::redraw() {
|
||||
range.first == *m_focus ? '*' : ' ',
|
||||
t.group(),
|
||||
rak::copy_escape_html(t.tracker_id()).c_str(),
|
||||
range.first == tl.focus() ? "yes" : " no",
|
||||
range.first == tl->focus() ? "yes" : " no",
|
||||
t.is_enabled() ? "yes" : " no",
|
||||
t.is_open() ? "yes" : " no",
|
||||
t.scrape_complete(),
|
||||
|
||||
Reference in New Issue
Block a user