QmlProfiler: Also handle RunControl::finished() signal

If you force-stop an application by closing the output tab, we don't get
a stopped() signal. In order to properly reset the UI we need to handle
the finished() signal then.

Change-Id: Ibab5faf86542a59c3eb3aa139bb3dc66afe89ce2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-01-15 10:35:17 +01:00
parent 6fe933b63a
commit f9a3ac7f08

View File

@@ -373,10 +373,16 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
}
}
connect(runControl, &RunControl::stopped, this, [this, runControl] {
auto handleStop = [this, runControl]() {
d->m_toolBusy = false;
updateRunActions();
disconnect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);
};
connect(runControl, &RunControl::stopped, this, handleStop);
connect(runControl, &RunControl::finished, this, [this, runControl, handleStop] {
if (d->m_toolBusy)
handleStop();
});
connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::initiateStop);