Deduplicate elapsed time formatting

While it's nice to see my code spreading,
I still prefer to have it at one place.

Change-Id: I7bdb13c47ed7e96227deeb14b0a8070aa40148de
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-02-28 15:09:35 +01:00
committed by André Hartmann
parent 41cb713370
commit d76a2f4fcd
6 changed files with 23 additions and 19 deletions

View File

@@ -35,6 +35,7 @@
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/stringutils.h>
#include <QDir>
#include <QObject>
@@ -237,11 +238,8 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
emit finished(code, status);
const QTime format = QTime(0, 0, 0, 0).addMSecs(m_elapsed.elapsed() + 500);
QString time = format.toString("h:mm:ss");
if (time.startsWith("0:"))
time.remove(0, 2); // Don't display zero hours
Core::MessageManager::write(tr("Elapsed time: %1.") .arg(time));
const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed());
Core::MessageManager::write(elapsedTime);
}
void CMakeProcess::checkForCancelled()