1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Don't display weird text in the 'Last Activity' column when the time is invalid.

This commit is contained in:
sledgehammer999 2014-11-26 14:51:52 +02:00
parent e907306b41
commit ecf3dd123e

View File

@ -210,6 +210,9 @@ 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;
if (elapsed < 0)
elapsedString = misc::userFriendlyDuration(elapsed);
else
elapsedString = tr("%1 ago", "e.g.: 1h 20m ago").arg(misc::userFriendlyDuration(elapsed)); 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;