Commit 61dc2936 authored by Andre Hartmann's avatar Andre Hartmann Committed by hjk

BuildManager: Display elapsed time after build.

Task-number: QTCREATORBUG-8617
Change-Id: I2883e2528ea59673e7f6658021e7f5f88faa3fa4
Reviewed-by: default avatarCristian Adam <cristian.adam@nokia.com>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 35457f6f
......@@ -55,6 +55,7 @@
#include <QList>
#include <QHash>
#include <QFutureWatcher>
#include <QElapsedTimer>
#include <utils/QtConcurrentTools>
......@@ -98,6 +99,8 @@ struct BuildManagerPrivate {
QFutureInterface<void> *m_progressFutureInterface;
QFutureWatcher<void> m_progressWatcher;
QPointer<Core::FutureProgress> m_futureProgress;
QElapsedTimer m_elapsed;
};
BuildManagerPrivate::BuildManagerPrivate() :
......@@ -244,6 +247,18 @@ void BuildManager::updateTaskCount()
void BuildManager::finish()
{
const int seconds = d->m_elapsed.elapsed() / 1000;
const int minutes = seconds / 60;
const int hours = minutes / 60;
QString maybeHours;
if (hours) {
maybeHours.setNum(hours);
maybeHours.append(QLatin1Char(':'));
}
addToOutputWindow(tr("Elapsed time: %1%2:%3.") .arg(maybeHours)
.arg(minutes % 60, 2, 10, QLatin1Char('0'))
.arg(seconds % 60, 2, 10, QLatin1Char('0')), BuildStep::MessageOutput);
QApplication::alert(Core::ICore::mainWindow(), 3000);
}
......@@ -308,6 +323,7 @@ void BuildManager::startBuildQueue(const QStringList &preambleMessage)
return;
}
if (!d->m_running) {
d->m_elapsed.start();
// Progress Reporting
Core::ProgressManager *progressManager = Core::ICore::progressManager();
d->m_progressFutureInterface = new QFutureInterface<void>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment