mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user