From e19ab0b7a9139da65e502520551deabee8452118 Mon Sep 17 00:00:00 2001 From: dubhater Date: Thu, 8 Mar 2018 14:12:52 +0200 Subject: [PATCH] Qt: Fix bad downloaded percentage in DetailsDialog It was always 0.0% as long as the torrent was not finished. --- qt/DetailsDialog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/DetailsDialog.cc b/qt/DetailsDialog.cc index d45d8ff36..01872d36b 100644 --- a/qt/DetailsDialog.cc +++ b/qt/DetailsDialog.cc @@ -513,7 +513,7 @@ void DetailsDialog::refresh() } } - double const d = 100.0 * (sizeWhenDone != 0 ? (sizeWhenDone - leftUntilDone) / sizeWhenDone : 1); + double const d = sizeWhenDone != 0 ? 100.0 * (sizeWhenDone - leftUntilDone) / sizeWhenDone : 100.0; QString pct = Formatter::percentToString(d); if (haveUnverified == 0 && leftUntilDone == 0)