From 1413346fa2634c7ba21bd15d8f86f6fa66f480c8 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 23 Oct 2021 23:45:10 -0500 Subject: [PATCH] fix: details dialog "available" percent can be off (#2025) It's often off by a little bit because it fails to account for blocks we've downloaded but haven't been verified yet. Copied the fix from the GTK client. --- qt/DetailsDialog.cc | 2 +- qt/Session.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/DetailsDialog.cc b/qt/DetailsDialog.cc index 53b2dfa1b..eaa29d76a 100644 --- a/qt/DetailsDialog.cc +++ b/qt/DetailsDialog.cc @@ -488,7 +488,7 @@ void DetailsDialog::refreshUI() have_verified += v; size_when_done += t->sizeWhenDone(); left_until_done += t->leftUntilDone(); - available += t->sizeWhenDone() - t->leftUntilDone() + t->desiredAvailable(); + available += t->sizeWhenDone() - t->leftUntilDone() + t->haveUnverified() + t->desiredAvailable(); } } diff --git a/qt/Session.cc b/qt/Session.cc index 67777d87d..996ceace8 100644 --- a/qt/Session.cc +++ b/qt/Session.cc @@ -581,7 +581,7 @@ std::vector const& Session::getKeyNames(TorrentProperties prop }; // changing fields needed by the details dialog - static auto constexpr DetailStatKeys = std::array{ + static auto constexpr DetailStatKeys = std::array{ TR_KEY_activityDate, // TR_KEY_bandwidthPriority, // TR_KEY_corruptEver, // @@ -590,6 +590,7 @@ std::vector const& Session::getKeyNames(TorrentProperties prop TR_KEY_downloadLimit, // TR_KEY_downloadLimited, // TR_KEY_fileStats, // + TR_KEY_haveUnchecked, // TR_KEY_honorsSessionLimits, // TR_KEY_peer_limit, // TR_KEY_peers, //