From 6bea659d506d1e449e8609be8e2ac34defcfddba Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 1 Sep 2013 16:45:57 +0300 Subject: [PATCH] Fix ETA calculation when some files are downloaded and marked afterwards as 'do not download'. --- src/qtlibtorrent/qtorrenthandle.cpp | 2 +- src/qtlibtorrent/torrentspeedmonitor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qtlibtorrent/qtorrenthandle.cpp b/src/qtlibtorrent/qtorrenthandle.cpp index 163f94308..19e12e247 100644 --- a/src/qtlibtorrent/qtorrenthandle.cpp +++ b/src/qtlibtorrent/qtorrenthandle.cpp @@ -404,7 +404,7 @@ bool QTorrentHandle::is_checking() const { size_type QTorrentHandle::total_done() const { #if LIBTORRENT_VERSION_NUM >= 001600 - return torrent_handle::status(0x0).total_done; + return torrent_handle::status(query_accurate_download_counters).total_done; #else return torrent_handle::status().total_done; #endif diff --git a/src/qtlibtorrent/torrentspeedmonitor.cpp b/src/qtlibtorrent/torrentspeedmonitor.cpp index 3d8c3f71f..e8a119d56 100644 --- a/src/qtlibtorrent/torrentspeedmonitor.cpp +++ b/src/qtlibtorrent/torrentspeedmonitor.cpp @@ -150,7 +150,7 @@ qlonglong TorrentSpeedMonitor::getETA(const QString &hash) const if (!speed_average.download) return MAX_ETA; - return (h.total_wanted() - h.total_done()) / speed_average.download; + return (h.total_wanted() - h.total_wanted_done()) / speed_average.download; } void TorrentSpeedMonitor::getSamples()