Commit 835ef950 authored by hjk's avatar hjk

Analyzer: Use the run mode stored in the parameters instead of a copy

Change-Id: I045622efa22bfcb26f9161556ccbbfb3df08599d
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
parent 84b47922
......@@ -754,12 +754,10 @@ void AnalyzerManager::handleToolFinished()
}
AnalyzerRunControl *AnalyzerManager::createRunControl(
const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode runMode)
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
{
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
if (tool->runMode() == runMode)
if (tool->runMode() == sp.runMode)
return tool->createRunControl(sp, runConfiguration);
QTC_CHECK(false);
return 0;
......
......@@ -93,7 +93,7 @@ public:
static QAction *stopAction();
static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode runMode);
ProjectExplorer::RunConfiguration *runConfiguration);
private:
friend class AnalyzerManagerPrivate;
......
......@@ -51,7 +51,7 @@ namespace Android {
namespace Internal {
RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfiguration *runConfig,
RunMode runMode, QString *errorMessage)
RunMode runMode)
{
Target *target = runConfig->target();
AnalyzerStartParameters params;
......@@ -68,8 +68,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
params.startMode = StartQmlRemote;
}
AnalyzerRunControl *analyzerRunControl =
AnalyzerManager::createRunControl(params, runConfig, runMode);
AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig);
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
return analyzerRunControl;
}
......
......@@ -48,7 +48,7 @@ class AndroidAnalyzeSupport : public AndroidRunSupport
public:
static ProjectExplorer::RunControl *createAnalyzeRunControl(AndroidRunConfiguration *runConfig,
ProjectExplorer::RunMode runMode, QString *errorMessage);
ProjectExplorer::RunMode runMode);
AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
Analyzer::AnalyzerRunControl *runControl);
......
......@@ -168,7 +168,7 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
case DebugRunMode:
return AndroidDebugSupport::createDebugRunControl(rc, errorMessage);
case QmlProfilerRunMode:
return AndroidAnalyzeSupport::createAnalyzeRunControl(rc, mode, errorMessage);
return AndroidAnalyzeSupport::createAnalyzeRunControl(rc, mode);
case NoRunMode:
case DebugRunModeWithBreakOnMain:
case CallgrindRunMode:
......
......@@ -123,7 +123,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration, mode);
AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration);
QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
if (!engine) {
delete rc;
......
......@@ -63,7 +63,7 @@ using namespace ProjectExplorer;
using namespace Qnx;
using namespace Qnx::Internal;
DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConfig)
static DebuggerStartParameters createDebuggerStartParameters(const QnxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
......@@ -114,7 +114,7 @@ DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConf
return params;
}
AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode)
static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode)
{
AnalyzerStartParameters params;
Target *target = runConfig->target();
......@@ -178,7 +178,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
case NormalRunMode:
return new QnxRunControl(rc);
case DebugRunMode: {
const DebuggerStartParameters params = createStartParameters(rc);
const DebuggerStartParameters params = createDebuggerStartParameters(rc);
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
if (!runControl)
return 0;
......@@ -190,7 +190,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
}
case QmlProfilerRunMode: {
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
return runControl;
......
......@@ -108,7 +108,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
}
case QmlProfilerRunMode: {
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
RemoteLinuxAnalyzeSupport * const analyzeSupport =
new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
......
......@@ -71,6 +71,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
AnalyzerStartParameters sp;
sp.displayName = runConfiguration->displayName();
sp.runMode = mode;
if (LocalApplicationRunConfiguration *rc1 =
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
EnvironmentAspect *aspect = runConfiguration->extraAspect<EnvironmentAspect>();
......@@ -102,7 +103,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
QTC_ASSERT(false, return 0);
}
return AnalyzerManager::createRunControl(sp, runConfiguration, mode);
return AnalyzerManager::createRunControl(sp, runConfiguration);
}
IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc)
......
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