analyzer: refactor progress

Change-Id: If74c8035bc83a8113c2a15dcacefa38afbbbb4d8
Reviewed-on: http://codereview.qt.nokia.com/1056
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-07-04 10:50:44 +02:00
committed by hjk
parent 1e79a68a14
commit 36a3028b9d
23 changed files with 317 additions and 229 deletions

View File

@@ -50,7 +50,7 @@ CodaQmlProfilerRunner::CodaQmlProfilerRunner(S60DeviceRunConfiguration *configur
QObject *parent) :
AbstractQmlProfilerRunner(parent),
m_configuration(configuration),
m_runControl(new CodaRunControl(configuration, Analyzer::Constants::MODE_ANALYZE))
m_runControl(new CodaRunControl(configuration, "QmlProfiler"))
{
connect(m_runControl, SIGNAL(finished()), this, SIGNAL(stopped()));
connect(m_runControl,

View File

@@ -159,7 +159,7 @@ void QmlProfilerEngine::stop()
void QmlProfilerEngine::stopped()
{
d->m_running = false;
AnalyzerManager::stopTool(tool(), mode());
AnalyzerManager::stopTool(); // FIXME: Needed?
emit finished();
}

View File

@@ -541,3 +541,11 @@ void QmlProfilerTool::updateRecordingState()
if (d->m_traceWindow->isRecording())
clearDisplay();
}
void QmlProfilerTool::startTool(StartMode mode)
{
if (mode == StartLocal)
AnalyzerManager::startLocalTool(this, mode);
if (mode == StartRemote)
AnalyzerManager::startLocalTool(this, mode);
}

View File

@@ -62,6 +62,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration = 0);
QWidget *createControlWidget();
void startTool(Analyzer::StartMode mode);
public slots:
void connectClient(int port);

View File

@@ -45,7 +45,7 @@ using namespace Analyzer;
using namespace ProjectExplorer;
using namespace QmlProfiler::Internal;
AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
static AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
{
AnalyzerStartParameters sp;
QTC_ASSERT(runConfiguration, return sp);
@@ -73,9 +73,8 @@ QmlProjectAnalyzerRunControlFactory::QmlProjectAnalyzerRunControlFactory(QObject
bool QmlProjectAnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
{
if (!qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration))
return false;
return mode == Constants::MODE_ANALYZE;
return mode.startsWith(QLatin1String("QmlProfiler"))
&& qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
}
RunControl *QmlProjectAnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
@@ -88,7 +87,7 @@ RunControl *QmlProjectAnalyzerRunControlFactory::create(RunConfiguration *runCon
AnalyzerRunControl *QmlProjectAnalyzerRunControlFactory::create
(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
{
return new AnalyzerRunControl(AnalyzerManager::toolById(sp.toolId), sp, runConfiguration);
return new AnalyzerRunControl(AnalyzerManager::toolFromId(sp.toolId), sp, runConfiguration);
}
QString QmlProjectAnalyzerRunControlFactory::displayName() const