diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
commit | 0680d2dceb27f18b1c888bf16079dfd00d07b3ca (patch) | |
tree | 6874b9733973fc6488a8ebe8bd394f73593b41a7 /launcher/MMCTime.cpp | |
parent | ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e (diff) | |
parent | 9110fbf2829a48c36fe37cabfb438e165956bbcf (diff) | |
download | PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.gz PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.bz2 PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/MMCTime.cpp')
-rw-r--r-- | launcher/MMCTime.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/launcher/MMCTime.cpp b/launcher/MMCTime.cpp index 3972dbd5..1765fd84 100644 --- a/launcher/MMCTime.cpp +++ b/launcher/MMCTime.cpp @@ -16,19 +16,20 @@ */ #include <MMCTime.h> +#include <qobject.h> #include <QDateTime> #include <QObject> #include <QTextStream> -QString Time::prettifyDuration(int64_t duration) +QString Time::prettifyDuration(int64_t duration, bool noDays) { int seconds = (int)(duration % 60); duration /= 60; int minutes = (int)(duration % 60); duration /= 60; - int hours = (int)(duration % 24); - int days = (int)(duration / 24); + int hours = (int)(noDays ? duration : (duration % 24)); + int days = (int)(noDays ? 0 : (duration / 24)); if ((hours == 0) && (days == 0)) { return QObject::tr("%1min %2s").arg(minutes).arg(seconds); } |