From: dubhater Date: Thu, 8 Mar 2018 12:12:52 +0000 (+0200) Subject: Qt: Fix bad downloaded percentage in DetailsDialog X-Git-Tag: 2.94~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85c0399d8c93b85bcb75dfc86b2b69428d0f2ad6;p=transmission Qt: Fix bad downloaded percentage in DetailsDialog It was always 0.0% as long as the torrent was not finished. --- diff --git a/qt/DetailsDialog.cc b/qt/DetailsDialog.cc index bb825cf47..6716d569f 100644 --- a/qt/DetailsDialog.cc +++ b/qt/DetailsDialog.cc @@ -442,7 +442,7 @@ DetailsDialog::refresh () } } - const double d = 100.0 * (sizeWhenDone ? (sizeWhenDone - leftUntilDone) / sizeWhenDone : 1); + const double d = sizeWhenDone ? 100.0 * (sizeWhenDone - leftUntilDone) / sizeWhenDone : 100.0; QString pct = Formatter::percentToString (d); if (!haveUnverified && !leftUntilDone)