Commit b7bb522d authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlProfiler: Fixing regression for non-recording runs

Reviewed-by: Kai Koehne
parent 19190384
......@@ -73,6 +73,7 @@ public:
QProcess *m_process;
bool m_running;
bool m_fetchingData;
bool m_delayedDelete;
};
QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration)
......@@ -83,6 +84,7 @@ QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp
d->m_process = 0;
d->m_running = false;
d->m_fetchingData = false;
d->m_delayedDelete = false;
}
QmlProfilerEngine::~QmlProfilerEngine()
......@@ -96,14 +98,18 @@ void QmlProfilerEngine::start()
{
d->launchperfmonitor();
d->m_running = true;
d->m_delayedDelete = false;
emit processRunning();
}
void QmlProfilerEngine::stop()
{
if (d->m_fetchingData)
if (d->m_fetchingData) {
if (d->m_running)
d->m_delayedDelete = true;
emit stopRecording();
}
else
finishProcess();
}
......@@ -120,6 +126,12 @@ void QmlProfilerEngine::setFetchingData(bool b)
d->m_fetchingData = b;
}
void QmlProfilerEngine::dataReceived() {
if (d->m_delayedDelete)
finishProcess();
d->m_delayedDelete = false;
}
void QmlProfilerEngine::finishProcess()
{
if (d->m_running) {
......
......@@ -58,6 +58,7 @@ public slots:
void spontaneousStop();
void setFetchingData(bool);
void dataReceived();
void finishProcess();
private:
......
......@@ -182,7 +182,7 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
connect(engine, SIGNAL(processRunning()), this, SLOT(connectClient()));
connect(engine, SIGNAL(finished()), this, SLOT(disconnectClient()));
connect(engine, SIGNAL(stopRecording()), this, SLOT(stopRecording()));
connect(d->m_traceWindow, SIGNAL(viewUpdated()), engine, SLOT(finishProcess()));
connect(d->m_traceWindow, SIGNAL(viewUpdated()), engine, SLOT(dataReceived()));
connect(this, SIGNAL(connectionFailed()), engine, SLOT(finishProcess()));
connect(this, SIGNAL(fetchingData(bool)), engine, SLOT(setFetchingData(bool)));
emit fetchingData(d->m_recordButton->isChecked());
......
Markdown is supported
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