From 0245bbf5ab19dde56f814f2c7763415b7779ad8c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 10 Oct 2007 19:10:34 +0000 Subject: [PATCH] - BUGFIX: Fixed an ETA calculation problem when the torrent has filtered files --- TODO | 3 ++- src/bittorrent.cpp | 2 +- src/qtorrenthandle.cpp | 4 ++-- src/qtorrenthandle.h | 2 +- src/src.pro | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 4574a9604..6275bd5ab 100644 --- a/TODO +++ b/TODO @@ -60,4 +60,5 @@ rc4->rc5 changelog: - BUGFIX: Now filtered don't appear on hard drive anymore (libtorrent >= r1659) -- BUGFIX: AddInPause setting doesn't pause downloads on startup anymore \ No newline at end of file +- BUGFIX: AddInPause setting doesn't pause downloads on startup anymore +- BUGFIX: Fixed an ETA calculation problem when the torrent has filtered files \ No newline at end of file diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index cd0cd95a4..d29e874ff 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -148,7 +148,7 @@ void bittorrent::updateETAs() { listEtas.removeFirst(); } if(h.download_payload_rate()) { - listEtas << (qlonglong)((h.actual_size()-h.total_done())/(double)h.download_payload_rate()); + listEtas << (qlonglong)((h.actual_size()-h.total_wanted_done())/(double)h.download_payload_rate()); ETAstats[hash] = listEtas; qlonglong moy = 0; qlonglong val; diff --git a/src/qtorrenthandle.cpp b/src/qtorrenthandle.cpp index 282dec4d7..c6ed3f58d 100644 --- a/src/qtorrenthandle.cpp +++ b/src/qtorrenthandle.cpp @@ -79,9 +79,9 @@ bool QTorrentHandle::is_paused() const { // return h.get_torrent_info().total_size(); // } -size_type QTorrentHandle::total_done() const { +size_type QTorrentHandle::total_wanted_done() const { Q_ASSERT(h.is_valid()); - return h.status().total_done; + return h.status().total_wanted_done; } float QTorrentHandle::download_payload_rate() const { diff --git a/src/qtorrenthandle.h b/src/qtorrenthandle.h index 445ebf7a3..6a644d39d 100644 --- a/src/qtorrenthandle.h +++ b/src/qtorrenthandle.h @@ -59,7 +59,7 @@ class QTorrentHandle { bool is_paused() const; bool has_filtered_pieces() const; // size_type total_size() const; - size_type total_done() const; + size_type total_wanted_done() const; float download_payload_rate() const; float upload_payload_rate() const; int num_peers() const; diff --git a/src/src.pro b/src/src.pro index ecb86946e..3788a7d70 100644 --- a/src/src.pro +++ b/src/src.pro @@ -30,7 +30,7 @@ contains(DEBUG_MODE, 0){ # For libtorrent stuff # (comment this if you are using libtorrent with debug enabled) -DEFINES += NDEBUG +#DEFINES += NDEBUG # Install