mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Don't display weird text in the 'Last Activity' column when the time is invalid.
This commit is contained in:
parent
e907306b41
commit
ecf3dd123e
@ -210,7 +210,10 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
|||||||
if (elapsed == 0)
|
if (elapsed == 0)
|
||||||
// Show '< 1m ago' when elapsed time is 0
|
// Show '< 1m ago' when elapsed time is 0
|
||||||
elapsed = 1;
|
elapsed = 1;
|
||||||
elapsedString = tr("%1 ago", "e.g.: 1h 20m ago").arg(misc::userFriendlyDuration(elapsed));
|
if (elapsed < 0)
|
||||||
|
elapsedString = misc::userFriendlyDuration(elapsed);
|
||||||
|
else
|
||||||
|
elapsedString = tr("%1 ago", "e.g.: 1h 20m ago").arg(misc::userFriendlyDuration(elapsed));
|
||||||
QItemDelegate::drawDisplay(painter, opt, option.rect, elapsedString);
|
QItemDelegate::drawDisplay(painter, opt, option.rect, elapsedString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user