From afa2fc0ba9df098065cbe93dc3b896a724efc13b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 6 Feb 2021 11:45:35 +0800 Subject: [PATCH] Apply "Hide zero values" to "Time Active" column --- src/gui/transferlistmodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/transferlistmodel.cpp b/src/gui/transferlistmodel.cpp index 5f8b6a3f0..7dcccd1fe 100644 --- a/src/gui/transferlistmodel.cpp +++ b/src/gui/transferlistmodel.cpp @@ -302,10 +302,14 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons : Utils::Misc::userFriendlyDuration(value); }; - const auto timeElapsedString = [](const qint64 elapsedTime, const qint64 seedingTime) -> QString + const auto timeElapsedString = [hideValues](const qint64 elapsedTime, const qint64 seedingTime) -> QString { if (seedingTime <= 0) + { + if (hideValues && (elapsedTime == 0)) + return {}; return Utils::Misc::userFriendlyDuration(elapsedTime); + } return tr("%1 (seeded for %2)", "e.g. 4m39s (seeded for 3m10s)") .arg(Utils::Misc::userFriendlyDuration(elapsedTime)