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

@@ -42,6 +42,7 @@
#include <cplusplus/LookupContext.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
#include <utils/stringutils.h>
#include <utils/temporarydirectory.h>
#include <QCoreApplication>
@@ -173,9 +174,8 @@ void indexFindErrors(QFutureInterface<void> &indexingFuture,
indexingFuture.setProgressValue(files.size() - (files.size() - (i + 1)));
}
const QTime format = QTime(0, 0, 0, 0).addMSecs(timer.elapsed() + 500);
const QString time = format.toString(QLatin1String("hh:mm:ss"));
qDebug("FindErrorsIndexing: Finished after %s.", qPrintable(time));
const QString elapsedTime = Utils::formatElapsedTime(timer.elapsed());
qDebug("FindErrorsIndexing: %s", qPrintable(elapsedTime));
}
void index(QFutureInterface<void> &indexingFuture,