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

@@ -61,6 +61,7 @@
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
#include <utils/stringutils.h>
#include <QAction>
#include <QLoggingCategory>
@@ -345,11 +346,8 @@ void ClangToolRunWorker::stop()
reportStopped();
// Print elapsed time since start
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
appendMessage(tr("Elapsed time: %1.") .arg(time), NormalMessageFormat);
const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed());
appendMessage(elapsedTime, NormalMessageFormat);
}
void ClangToolRunWorker::analyzeNextFile()