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

QmlProfiler: managing failed starts gracefully

Change-Id: Ice0debcb6b83977b8f50dd154687e7c5c6abac7b
Reviewed-on: http://codereview.qt.nokia.com/2113

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 5f785111
......@@ -119,9 +119,11 @@ void AnalyzerRunControl::start()
TaskHub *hub = pm->getObject<TaskHub>();
hub->clearTasks(Constants::ANALYZERTASK_ID);
d->m_isRunning = true;
emit started();
d->m_engine->start();
if (d->m_engine->start()) {
d->m_isRunning = true;
emit started();
}
}
RunControl::StopResult AnalyzerRunControl::stop()
......
......@@ -69,7 +69,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration);
/// Start analyzation process.
virtual void start() = 0;
virtual bool start() = 0;
/// Trigger async stop of the analyzation process.
virtual void stop() = 0;
......
......@@ -144,7 +144,7 @@ QmlProfilerEngine::~QmlProfilerEngine()
delete d;
}
void QmlProfilerEngine::start()
bool QmlProfilerEngine::start()
{
if (d->m_runner) {
delete d->m_runner;
......@@ -156,7 +156,7 @@ void QmlProfilerEngine::start()
if (rc->observerPath().isEmpty()) {
QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning();
AnalyzerManager::stopTool();
return;
return false;
}
}
......@@ -166,7 +166,7 @@ void QmlProfilerEngine::start()
if (!qmlRunner->hasExecutable()) {
showNonmodalWarning(tr("No executable file to launch."));
AnalyzerManager::stopTool();
return;
return false;
}
}
......@@ -184,6 +184,7 @@ void QmlProfilerEngine::start()
}
AnalyzerManager::handleToolStarted();
return true;
}
void QmlProfilerEngine::stop()
......
......@@ -54,7 +54,7 @@ signals:
void stopRecording();
public slots:
void start();
bool start();
void stop();
private slots:
......
......@@ -101,10 +101,10 @@ Valgrind::ValgrindRunner * CallgrindEngine::runner()
return &m_runner;
}
void CallgrindEngine::start()
bool CallgrindEngine::start()
{
emit outputReceived(tr("Profiling %1\n").arg(executable()), Utils::NormalMessageFormat);
ValgrindEngine::start();
return ValgrindEngine::start();
}
void CallgrindEngine::dump()
......
......@@ -49,7 +49,7 @@ public:
CallgrindEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
void start();
bool start();
Valgrind::Callgrind::ParseData *takeParserData();
......
......@@ -75,13 +75,13 @@ Valgrind::ValgrindRunner *MemcheckEngine::runner()
return &m_runner;
}
void MemcheckEngine::start()
bool MemcheckEngine::start()
{
m_runner.setParser(&m_parser);
emit outputReceived(tr("Analyzing memory of %1\n").arg(executable()),
Utils::NormalMessageFormat);
ValgrindEngine::start();
return ValgrindEngine::start();
}
void MemcheckEngine::stop()
......
......@@ -51,7 +51,7 @@ public:
MemcheckEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
void start();
bool start();
void stop();
QStringList suppressionFiles() const;
......
......@@ -77,7 +77,7 @@ ValgrindEngine::~ValgrindEngine()
delete m_progress;
}
void ValgrindEngine::start()
bool ValgrindEngine::start()
{
emit starting(this);
......@@ -115,6 +115,8 @@ void ValgrindEngine::start()
runner()->startRemotely(sp.connParams);
else
runner()->start();
return true;
}
void ValgrindEngine::stop()
......
......@@ -63,7 +63,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration);
~ValgrindEngine();
void start();
bool start();
void stop();
QString executable() const;
......
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