forked from qt-creator/qt-creator
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:
committed by
André Hartmann
parent
41cb713370
commit
d76a2f4fcd
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user