diff options
Diffstat (limited to 'launcher/MainWindow.cpp')
-rw-r--r-- | launcher/MainWindow.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/launcher/MainWindow.cpp b/launcher/MainWindow.cpp index c3cc6b8d..d394238a 100644 --- a/launcher/MainWindow.cpp +++ b/launcher/MainWindow.cpp @@ -88,6 +88,7 @@ #include "UpdateController.h" #include "KonamiCode.h" #include <InstanceCopyTask.h> +#include "MMCTime.h" namespace { QString profileInUseFilter(const QString & profile, bool used) @@ -1926,15 +1927,8 @@ void MainWindow::checkInstancePathForProblems() void MainWindow::updateStatusCenter() { - int timeplayed = LAUNCHER->instances()->getTotalPlayTime(); - int minutesTotal = timeplayed / 60; - int seconds = timeplayed % 60; - int minutes = minutesTotal % 60; - int hours = minutesTotal / 60; - if(hours != 0) - m_statusCenter->setText(tr("Total playtime: %1h %2m %3s").arg(hours).arg(minutes).arg(seconds)); - else if(minutes != 0) - m_statusCenter->setText(tr("Total playtime: %1m %2s").arg(minutes).arg(seconds)); - else if(seconds != 0) - m_statusCenter->setText(tr("Total playtime: %1s").arg(seconds)); + int timePlayed = LAUNCHER->instances()->getTotalPlayTime(); + if (timePlayed > 0) { + m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed))); + } } |