Qt: Avoid showing "0 minutes" of played time (#3447)

This commit is contained in:
Davide Pesavento 2025-06-13 23:00:19 -04:00 committed by GitHub
parent 9c4e15ef1c
commit 5dc55bb4a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -357,8 +357,10 @@ QString GameListModel::formatTimespan(time_t timespan)
const u32 minutes = static_cast<u32>((timespan % 3600) / 60);
if (hours > 0)
return qApp->translate("GameList", "%n hours", "", hours);
else
else if (minutes > 0)
return qApp->translate("GameList", "%n minutes", "", minutes);
else
return qApp->translate("GameList", "%n seconds", "", static_cast<u32>((timespan % 3600) % 60));
}
const QPixmap& GameListModel::getIconPixmapForEntry(const GameList::Entry* ge) const