QmlProfiler: If disconnected while serverRecording, show warning

... unless we actually triggered AppStopRequested. Furthermore, don't
clear the data in that case. The incomplete data could still be of some
value, and we call finalize() later on, which would otherwise confuse
the trace manager.

Fixes: QTCREATORBUG-22187
Change-Id: Ic4373201d6e9f29583186708a7acb6ba2ddcd502
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Ulf Hermann
2019-04-09 13:07:10 +02:00
parent 7e0c17eb37
commit c70f59075d

View File

@@ -687,11 +687,9 @@ void QmlProfilerTool::clientsDisconnected()
d->m_profilerModelManager->finalize(); d->m_profilerModelManager->finalize();
} else if (d->m_profilerState->serverRecording()) { } else if (d->m_profilerState->serverRecording()) {
// If the application stopped by itself, check if we have all the data // If the application stopped by itself, check if we have all the data
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying || if (d->m_profilerState->currentState() != QmlProfilerStateManager::AppStopRequested) {
d->m_profilerState->currentState() == QmlProfilerStateManager::Idle) {
showNonmodalWarning(tr("Application finished before loading profiled data.\n" showNonmodalWarning(tr("Application finished before loading profiled data.\n"
"Please use the stop button instead.")); "Please use the stop button instead."));
d->m_profilerModelManager->clearAll();
} }
} }
} }