Commit 88476a14 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Disable run controls after they are finished



Disabled runControls would still receive and send signals, confusing
the profiler state.

Also, connect lambdas with receiver argument where possible.

Change-Id: I0cd43456d3462efe402e9d68792b67314e9b6e0b
Task-number: QTCREATORBUG-16073
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 20110d1e
......@@ -101,7 +101,7 @@ QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration,
QmlProfilerRunControl::~QmlProfilerRunControl()
{
if (d->m_profilerState)
if (d->m_running && d->m_profilerState)
stop();
delete d;
}
......
......@@ -333,12 +333,13 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(RunConfiguration *runConfi
}
auto runControl = new QmlProfilerRunControl(runConfiguration, this);
connect(runControl, &RunControl::finished, [this, runControl] {
connect(runControl, &RunControl::finished, this, [this, runControl] {
d->m_toolBusy = false;
updateRunActions();
disconnect(d->m_stopAction, &QAction::triggered, runControl, &QmlProfilerRunControl::stop);
});
connect(d->m_stopAction, &QAction::triggered, runControl, [runControl] { runControl->stop(); });
connect(d->m_stopAction, &QAction::triggered, runControl, &QmlProfilerRunControl::stop);
updateRunActions();
return runControl;
......
Supports Markdown
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