diff options
| author | Silarn <jrim@rimpo.org> | 2019-02-05 22:38:46 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-02-18 21:31:20 -0600 |
| commit | 8bc9db23d98ae454899791af9e0fbc0bab4d0b15 (patch) | |
| tree | 372f10f58879b6726e777ff4e295a7461f880a38 /src/modlist.cpp | |
| parent | eb575e2f92e00e32220e7aa8efaf14ece462c981 (diff) | |
Add settings option to switch between fixed and dynamic cache timeouts
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 += "<br>" + 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 += "<br>" + 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 += "<br>" + tr("This mod is eligible for an update check."); text += "<br>" + tr("It was last checked on %1").arg(modInfo->getLastNexusUpdate().toLocalTime().toString(Qt::DefaultLocaleShortDate)); |
