* 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:
rakshasa
2006-04-06 16:40:25 +00:00
parent 8a8cfe5e3d
commit dc1f6d4f23
4 changed files with 141 additions and 182 deletions
+7 -9
View File
@@ -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(),