diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-20 13:04:44 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-20 16:15:32 +0000 |
commit | 5bc6bf03e156677599fc9efd5c73c1c571b97742 (patch) | |
tree | c69381dc09bba7727071f569fb89572ebb8e81ac | |
parent | 69377f0de47e414f10cfcf336b4fe648dbc82332 (diff) | |
download | qt-creator-5bc6bf03e156677599fc9efd5c73c1c571b97742.tar.gz |
QmlProfiler: Don't update the time display during state transitions
Previously, the display would show 0.0 while the profiler was waiting
for the application to send data. That is somewhat confusing.
Change-Id: I3ad85e5479c2cf3a65e6c4b411d959a5b15baae8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index f80768dd98..915d3fd84c 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -416,12 +416,20 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber, void QmlProfilerTool::updateTimeDisplay() { double seconds = 0; - if (d->m_profilerState->serverRecording() && - d->m_profilerState->currentState() == QmlProfilerStateManager::AppRunning) { + switch (d->m_profilerState->currentState()) { + case QmlProfilerStateManager::AppStopRequested: + case QmlProfilerStateManager::AppDying: + return; // Transitional state: don't update the display. + case QmlProfilerStateManager::AppRunning: + if (d->m_profilerState->serverRecording()) { seconds = d->m_recordingElapsedTime.elapsed() / 1000.0; - } else if (d->m_profilerModelManager->state() != QmlProfilerModelManager::Empty && - d->m_profilerModelManager->state() != QmlProfilerModelManager::ClearingData) { - seconds = d->m_profilerModelManager->traceTime()->duration() / 1.0e9; + break; + } // else fall through + case QmlProfilerStateManager::Idle: + if (d->m_profilerModelManager->state() != QmlProfilerModelManager::Empty && + d->m_profilerModelManager->state() != QmlProfilerModelManager::ClearingData) + seconds = d->m_profilerModelManager->traceTime()->duration() / 1.0e9; + break; } QString timeString = QString::number(seconds,'f',1); QString profilerTimeStr = QmlProfilerTool::tr("%1 s").arg(timeString, 6); |