QmlProfiler: Re-enable attaching to a (remote) port

Change-Id: Iff5f8cf26e580ede4f82aba5a36acd785521da8d
Reviewed-on: http://codereview.qt-project.org/4890
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Kai Koehne
2011-09-14 13:12:25 +02:00
parent 26f163570b
commit 6b1f96bf7b
6 changed files with 82 additions and 65 deletions

View File

@@ -92,6 +92,8 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
QObject *parent)
{
AbstractQmlProfilerRunner *runner = 0;
if (!runConfiguration) // attaching
return 0;
if (QmlProjectManager::QmlProjectRunConfiguration *rc1 =
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration)) {
// This is a "plain" .qmlproject.
@@ -129,8 +131,9 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
//
QmlProfilerEngine::QmlProfilerEngine(IAnalyzerTool *tool,
ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(tool, runConfiguration)
const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration)
: IAnalyzerEngine(tool, sp, runConfiguration)
, d(new QmlProfilerEnginePrivate(this))
{
d->m_running = false;
@@ -178,12 +181,16 @@ bool QmlProfilerEngine::start()
}
}
connect(d->m_runner, SIGNAL(stopped()), this, SLOT(stopped()));
connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
this, SLOT(logApplicationMessage(QString,Utils::OutputFormat)));
if (d->m_runner) {
connect(d->m_runner, SIGNAL(stopped()), this, SLOT(stopped()));
connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
this, SLOT(logApplicationMessage(QString,Utils::OutputFormat)));
d->m_runner->start();
d->m_noDebugOutputTimer.start();
} else {
emit processRunning(startParameters().connParams.port);
}
d->m_noDebugOutputTimer.start();
d->m_runner->start();
d->m_running = true;
d->m_delayedDelete = false;
@@ -246,7 +253,8 @@ void QmlProfilerEngine::finishProcess()
// user stop?
if (d->m_running) {
d->m_running = false;
d->m_runner->stop();
if (d->m_runner)
d->m_runner->stop();
emit finished();
}
}