Browse Source

- BUGFIX: Fixed an ETA calculation problem when the torrent has filtered files

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
0245bbf5ab
  1. 3
      TODO
  2. 2
      src/bittorrent.cpp
  3. 4
      src/qtorrenthandle.cpp
  4. 2
      src/qtorrenthandle.h
  5. 2
      src/src.pro

3
TODO

@ -60,4 +60,5 @@
rc4->rc5 changelog: rc4->rc5 changelog:
- BUGFIX: Now filtered don't appear on hard drive anymore (libtorrent >= r1659) - BUGFIX: Now filtered don't appear on hard drive anymore (libtorrent >= r1659)
- BUGFIX: AddInPause setting doesn't pause downloads on startup anymore - BUGFIX: AddInPause setting doesn't pause downloads on startup anymore
- BUGFIX: Fixed an ETA calculation problem when the torrent has filtered files

2
src/bittorrent.cpp

@ -148,7 +148,7 @@ void bittorrent::updateETAs() {
listEtas.removeFirst(); listEtas.removeFirst();
} }
if(h.download_payload_rate()) { 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; ETAstats[hash] = listEtas;
qlonglong moy = 0; qlonglong moy = 0;
qlonglong val; qlonglong val;

4
src/qtorrenthandle.cpp

@ -79,9 +79,9 @@ bool QTorrentHandle::is_paused() const {
// return h.get_torrent_info().total_size(); // 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()); Q_ASSERT(h.is_valid());
return h.status().total_done; return h.status().total_wanted_done;
} }
float QTorrentHandle::download_payload_rate() const { float QTorrentHandle::download_payload_rate() const {

2
src/qtorrenthandle.h

@ -59,7 +59,7 @@ class QTorrentHandle {
bool is_paused() const; bool is_paused() const;
bool has_filtered_pieces() const; bool has_filtered_pieces() const;
// size_type total_size() const; // size_type total_size() const;
size_type total_done() const; size_type total_wanted_done() const;
float download_payload_rate() const; float download_payload_rate() const;
float upload_payload_rate() const; float upload_payload_rate() const;
int num_peers() const; int num_peers() const;

2
src/src.pro

@ -30,7 +30,7 @@ contains(DEBUG_MODE, 0){
# For libtorrent stuff # For libtorrent stuff
# (comment this if you are using libtorrent with debug enabled) # (comment this if you are using libtorrent with debug enabled)
DEFINES += NDEBUG #DEFINES += NDEBUG
# Install # Install

Loading…
Cancel
Save