mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Apply "Hide infinity values" to ETA column
This commit is contained in:
parent
2aeb8b9390
commit
0d550c9bce
1 changed files with 8 additions and 1 deletions
|
@ -274,6 +274,13 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
|||
return QString::fromLatin1("%1 (%2)").arg(QString::number(value), QString::number(total));
|
||||
};
|
||||
|
||||
const auto etaString = [hideValues](const qlonglong value) -> QString
|
||||
{
|
||||
if (hideValues && (value >= MAX_ETA))
|
||||
return {};
|
||||
return Utils::Misc::userFriendlyDuration(value, MAX_ETA);
|
||||
};
|
||||
|
||||
const auto ratioString = [hideValues](const qreal value) -> QString
|
||||
{
|
||||
if (hideValues && (value <= 0))
|
||||
|
@ -358,7 +365,7 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
|
|||
case TR_UPSPEED:
|
||||
return unitString(torrent->uploadPayloadRate(), true);
|
||||
case TR_ETA:
|
||||
return Utils::Misc::userFriendlyDuration(torrent->eta(), MAX_ETA);
|
||||
return etaString(torrent->eta());
|
||||
case TR_RATIO:
|
||||
return ratioString(torrent->realRatio());
|
||||
case TR_RATIO_LIMIT:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue