Fixed bug in display code for peer percentage progress.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@325 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-05 02:20:45 +00:00
parent c15d840962
commit 2dc7ffdb8f
7 changed files with 25 additions and 17 deletions
+8 -1
View File
@@ -98,7 +98,7 @@ WindowPeerList::redraw() {
itr->get_incoming_queue_size());
x += 6;
m_canvas->print(x, y, "%3i", (itr->get_chunks_done() * 100) / m_download->get_download().get_chunks_total());
m_canvas->print(x, y, "%3i", done_percentage(*itr));
x += 6;
if (itr->get_incoming_queue_size())
@@ -115,4 +115,11 @@ WindowPeerList::redraw() {
}
}
int
WindowPeerList::done_percentage(torrent::Peer& p) {
int chunks = m_download->get_download().get_chunks_total();
return chunks ? (100 * p.get_chunks_done()) / chunks : 0;
}
}