Apply "Hide zero values" to "Time Active" column

This commit is contained in:
Chocobo1 2021-02-06 11:45:35 +08:00
parent 6a45919b25
commit afa2fc0ba9
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -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)