forked from qt-creator/qt-creator
QmlProfiler: Fixing regression for non-recording runs
Reviewed-by: Kai Koehne
This commit is contained in:
@@ -73,6 +73,7 @@ public:
|
|||||||
QProcess *m_process;
|
QProcess *m_process;
|
||||||
bool m_running;
|
bool m_running;
|
||||||
bool m_fetchingData;
|
bool m_fetchingData;
|
||||||
|
bool m_delayedDelete;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration)
|
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_process = 0;
|
||||||
d->m_running = false;
|
d->m_running = false;
|
||||||
d->m_fetchingData = false;
|
d->m_fetchingData = false;
|
||||||
|
d->m_delayedDelete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlProfilerEngine::~QmlProfilerEngine()
|
QmlProfilerEngine::~QmlProfilerEngine()
|
||||||
@@ -96,14 +98,18 @@ void QmlProfilerEngine::start()
|
|||||||
{
|
{
|
||||||
d->launchperfmonitor();
|
d->launchperfmonitor();
|
||||||
d->m_running = true;
|
d->m_running = true;
|
||||||
|
d->m_delayedDelete = false;
|
||||||
|
|
||||||
emit processRunning();
|
emit processRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerEngine::stop()
|
void QmlProfilerEngine::stop()
|
||||||
{
|
{
|
||||||
if (d->m_fetchingData)
|
if (d->m_fetchingData) {
|
||||||
|
if (d->m_running)
|
||||||
|
d->m_delayedDelete = true;
|
||||||
emit stopRecording();
|
emit stopRecording();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
finishProcess();
|
finishProcess();
|
||||||
}
|
}
|
||||||
@@ -120,6 +126,12 @@ void QmlProfilerEngine::setFetchingData(bool b)
|
|||||||
d->m_fetchingData = b;
|
d->m_fetchingData = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlProfilerEngine::dataReceived() {
|
||||||
|
if (d->m_delayedDelete)
|
||||||
|
finishProcess();
|
||||||
|
d->m_delayedDelete = false;
|
||||||
|
}
|
||||||
|
|
||||||
void QmlProfilerEngine::finishProcess()
|
void QmlProfilerEngine::finishProcess()
|
||||||
{
|
{
|
||||||
if (d->m_running) {
|
if (d->m_running) {
|
||||||
|
@@ -58,6 +58,7 @@ public slots:
|
|||||||
void spontaneousStop();
|
void spontaneousStop();
|
||||||
|
|
||||||
void setFetchingData(bool);
|
void setFetchingData(bool);
|
||||||
|
void dataReceived();
|
||||||
void finishProcess();
|
void finishProcess();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -182,7 +182,7 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
|
|||||||
connect(engine, SIGNAL(processRunning()), this, SLOT(connectClient()));
|
connect(engine, SIGNAL(processRunning()), this, SLOT(connectClient()));
|
||||||
connect(engine, SIGNAL(finished()), this, SLOT(disconnectClient()));
|
connect(engine, SIGNAL(finished()), this, SLOT(disconnectClient()));
|
||||||
connect(engine, SIGNAL(stopRecording()), this, SLOT(stopRecording()));
|
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(connectionFailed()), engine, SLOT(finishProcess()));
|
||||||
connect(this, SIGNAL(fetchingData(bool)), engine, SLOT(setFetchingData(bool)));
|
connect(this, SIGNAL(fetchingData(bool)), engine, SLOT(setFetchingData(bool)));
|
||||||
emit fetchingData(d->m_recordButton->isChecked());
|
emit fetchingData(d->m_recordButton->isChecked());
|
||||||
|
Reference in New Issue
Block a user