From 8bc9db23d98ae454899791af9e0fbc0bab4d0b15 Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 5 Feb 2019 22:38:46 -0600 Subject: Add settings option to switch between fixed and dynamic cache timeouts --- src/modlist.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index c252d73b..55241492 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -465,9 +465,13 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const } if (modInfo->getNexusID() > 0) { if (!modInfo->canBeUpdated()) { - text += "
" + tr("This mod was last checked on %1. It will be available to check after %2.") + qint64 remains = QDateTime::currentDateTimeUtc().secsTo(modInfo->getExpires()); + qint64 hours = remains / 3600; + qint64 minutes = (remains % 3600) / 60; + QString remainsStr(tr("%1 hours and %2 minutes").arg(hours).arg(minutes)); + text += "
" + tr("This mod was last checked on %1. It will be available to check in %2.") .arg(modInfo->getLastNexusUpdate().toLocalTime().toString(Qt::DefaultLocaleShortDate)) - .arg(modInfo->getExpires().toLocalTime().time().toString(Qt::DefaultLocaleShortDate)); + .arg(remainsStr); } else { text += "
" + tr("This mod is eligible for an update check."); text += "
" + tr("It was last checked on %1").arg(modInfo->getLastNexusUpdate().toLocalTime().toString(Qt::DefaultLocaleShortDate)); -- cgit v1.3.1