diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp index db7022f4e99..7455e4b640c 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -47,28 +46,17 @@ LocalQmlProfilerRunner *LocalQmlProfilerRunner::createLocalRunner( QString *errorMessage, QmlProfilerRunControl *engine) { - QmlProjectManager::QmlProjectRunConfiguration *rc1 = - qobject_cast(runConfiguration); - LocalApplicationRunConfiguration *rc2 = + LocalApplicationRunConfiguration *larc = qobject_cast(runConfiguration); - QTC_ASSERT(rc1 || rc2, return 0); + QTC_ASSERT(larc, return 0); ProjectExplorer::EnvironmentAspect *environment = runConfiguration->extraAspect(); QTC_ASSERT(environment, return 0); Configuration conf; - if (rc1) { - // This is a "plain" .qmlproject. - conf.executable = rc1->executable(); - conf.executableArguments = rc1->commandLineArguments(); - conf.workingDirectory = rc1->workingDirectory(); - conf.environment = environment->environment(); - } else { - // FIXME: Check. - conf.executable = rc2->executable(); - conf.executableArguments = rc2->commandLineArguments(); - conf.workingDirectory = rc2->workingDirectory(); - conf.environment = environment->environment(); - } + conf.executable = larc->executable(); + conf.executableArguments = larc->commandLineArguments(); + conf.workingDirectory = larc->workingDirectory(); + conf.environment = environment->environment(); conf.port = sp.analyzerPort; diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 2b7e5421faf..38dc6f5901c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -111,8 +110,8 @@ bool QmlProfilerRunControl::startEngine() d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppStarting); - if (QmlProjectManager::QmlProjectRunConfiguration *rc = - qobject_cast(runConfiguration())) { + if (ProjectExplorer::LocalApplicationRunConfiguration *rc = + qobject_cast(runConfiguration())) { if (rc->executable().isEmpty()) { QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning(); d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp index c4cd238e856..0d4fa894a46 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp @@ -46,8 +46,6 @@ #include #include -#include - #include #include @@ -66,8 +64,7 @@ QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) : bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const { return mode == QmlProfilerRunMode - && (qobject_cast(runConfiguration) - || qobject_cast(runConfiguration)); + && (qobject_cast(runConfiguration)); } static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration *runConfiguration) @@ -76,27 +73,16 @@ static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration EnvironmentAspect *environment = runConfiguration->extraAspect(); // FIXME: This is only used to communicate the connParams settings. - if (QmlProjectManager::QmlProjectRunConfiguration *rc1 = - qobject_cast(runConfiguration)) { - // This is a "plain" .qmlproject. - if (environment) - sp.environment = environment->environment(); - sp.workingDirectory = rc1->workingDirectory(); - sp.debuggee = rc1->executable(); - sp.debuggeeArgs = rc1->commandLineArguments(); - sp.displayName = rc1->displayName(); - } else if (LocalApplicationRunConfiguration *rc2 = - qobject_cast(runConfiguration)) { - if (environment) - sp.environment = environment->environment(); - sp.workingDirectory = rc2->workingDirectory(); - sp.debuggee = rc2->executable(); - sp.debuggeeArgs = rc2->commandLineArguments(); - sp.displayName = rc2->displayName(); - } else { - // What could that be? - QTC_ASSERT(false, return sp); - } + LocalApplicationRunConfiguration *rc = + qobject_cast(runConfiguration); + QTC_ASSERT(rc, return sp); + if (environment) + sp.environment = environment->environment(); + sp.workingDirectory = rc->workingDirectory(); + sp.debuggee = rc->executable(); + sp.debuggeeArgs = rc->commandLineArguments(); + sp.displayName = rc->displayName(); + const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { QTcpServer server;