mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Merge pull request #7499 from Chocobo1/fixTimeActive
Fix "Time active" field in transfer list
This commit is contained in:
commit
49802be7d4
@ -122,13 +122,13 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TorrentModel::TR_TIME_ELAPSED: {
|
case TorrentModel::TR_TIME_ELAPSED: {
|
||||||
qlonglong elapsedTime = index.data().toLongLong();
|
const int elapsedTime = index.data().toInt();
|
||||||
qlonglong seedingTime = index.data(Qt::UserRole).toLongLong();
|
const int seedingTime = index.data(Qt::UserRole).toInt();
|
||||||
QString txt;
|
const QString txt = (seedingTime > 0)
|
||||||
if (seedingTime > 0)
|
? tr("%1 (seeded for %2)", "e.g. 4m39s (seeded for 3m10s)")
|
||||||
txt += tr("%1 (seeded for %2)", "e.g. 4m39s (seeded for 3m10s)")
|
|
||||||
.arg(Utils::Misc::userFriendlyDuration(elapsedTime))
|
.arg(Utils::Misc::userFriendlyDuration(elapsedTime))
|
||||||
.arg(Utils::Misc::userFriendlyDuration(seedingTime));
|
.arg(Utils::Misc::userFriendlyDuration(seedingTime))
|
||||||
|
: Utils::Misc::userFriendlyDuration(elapsedTime);
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, txt);
|
QItemDelegate::drawDisplay(painter, opt, opt.rect, txt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user