QmlProfiler: Fix logic in QmlProfilerTool::clientsDisconnected()

We want to do acquiringDone(), no matter if the app died or not.
Otherwise we wait forever for more data to arrive if the app has not
died.

Change-Id: Iad807ad75d7b8aba899211497586e5324124d16a
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-01-22 17:43:09 +01:00
parent a1dd1e4c5b
commit ed96957714

View File

@@ -648,24 +648,23 @@ void QmlProfilerTool::restoreFeatureVisibility()
void QmlProfilerTool::clientsDisconnected()
{
// If the application stopped by itself, check if we have all the data
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying ||
d->m_profilerState->currentState() == QmlProfilerStateManager::Idle) {
if (d->m_profilerModelManager->state() == QmlProfilerModelManager::AcquiringData) {
if (d->m_profilerConnections->aggregateTraces()) {
d->m_profilerModelManager->acquiringDone();
} else {
if (d->m_profilerModelManager->state() == QmlProfilerModelManager::AcquiringData) {
if (d->m_profilerConnections->aggregateTraces()) {
d->m_profilerModelManager->acquiringDone();
} else {
// If the application stopped by itself, check if we have all the data
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying ||
d->m_profilerState->currentState() == QmlProfilerStateManager::Idle) {
showNonmodalWarning(tr("Application finished before loading profiled data.\n"
"Please use the stop button instead."));
d->m_profilerModelManager->clear();
}
}
// ... and return to the "base" state
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying)
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
}
// If the connection is closed while the app is still running, no special action is needed
// ... and return to the "base" state
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying)
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
}
void addFeatureToMenu(QMenu *menu, ProfileFeature feature, quint64 enabledFeatures)