diff options
author | hjk <hjk@qt.io> | 2017-04-13 09:01:54 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-04-21 10:36:15 +0000 |
commit | 230524da162ae2ab101715172a6c553f56e51b60 (patch) | |
tree | b56e588371d0e1f1ae6d29bc76fdda88467aacda | |
parent | d87afd4b89b568c2b4545180c04181a1ebf32377 (diff) |
ProjectExplorer: Dissolve SimpleRunControl
As planned.
Change-Id: I9d9349cdd174c47b2331095fbe545b811e6ca770
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | src/plugins/nim/project/nimruncontrolfactory.cpp | 10 | ||||
-rw-r--r-- | src/plugins/projectexplorer/localapplicationruncontrol.cpp | 4 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.cpp | 12 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.h | 8 | ||||
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qnx/qnxruncontrol.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qnx/qnxruncontrol.h | 2 | ||||
-rw-r--r-- | src/plugins/qnx/qnxruncontrolfactory.cpp | 7 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp | 7 |
9 files changed, 27 insertions, 31 deletions
diff --git a/src/plugins/nim/project/nimruncontrolfactory.cpp b/src/plugins/nim/project/nimruncontrolfactory.cpp index 170e79f82d..55f6eaba1a 100644 --- a/src/plugins/nim/project/nimruncontrolfactory.cpp +++ b/src/plugins/nim/project/nimruncontrolfactory.cpp @@ -26,6 +26,8 @@ #include "nimruncontrolfactory.h" #include "nimrunconfiguration.h" +using namespace ProjectExplorer; + namespace Nim { bool NimRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, Core::Id mode) const @@ -34,12 +36,14 @@ bool NimRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfigur return dynamic_cast<NimRunConfiguration *>(runConfiguration); } -ProjectExplorer::RunControl *NimRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) +RunControl *NimRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) { Q_UNUSED(errorMessage) QTC_ASSERT(canRun(runConfiguration, mode), return 0); - return new ProjectExplorer::SimpleRunControl(runConfiguration, mode); + auto runControl = new RunControl(runConfiguration, mode); + (void) new SimpleTargetRunner(runControl); + return runControl; } -} +} // Nim diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index bb13231ae9..433998fc64 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -61,7 +61,9 @@ bool LocalApplicationRunControlFactory::canRun(RunConfiguration *runConfiguratio RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) { Q_UNUSED(errorMessage) - return new SimpleRunControl(runConfiguration, mode); + auto runControl = new RunControl(runConfiguration, mode); + (void) new SimpleTargetRunner(runControl); + return runControl; } } // namespace Internal diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 15e852255d..168d164c2a 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -522,6 +522,7 @@ public: RunControlPrivate(RunControl *parent, RunConfiguration *runConfiguration, Core::Id mode) : q(parent), runMode(mode), runConfiguration(runConfiguration) { + icon = Icons::RUN_SMALL_TOOLBAR; if (runConfiguration) { runnable = runConfiguration->runnable(); displayName = runConfiguration->displayName(); @@ -1213,15 +1214,4 @@ IDevice::ConstPtr ToolRunner::device() const return m_runControl->device(); } - -// SimpleRunControl - -SimpleRunControl::SimpleRunControl(RunConfiguration *runConfiguration, Core::Id mode) - : RunControl(runConfiguration, mode) -{ - setRunnable(runConfiguration->runnable()); - setIcon(Utils::Icons::RUN_SMALL_TOOLBAR); - (void) new SimpleTargetRunner(this); -} - } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 2318290520..a466f4d42f 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -522,12 +522,4 @@ private: ApplicationLauncher m_launcher; }; -// A RunControl with a SimpleTargetRunner and no Tool. -// FIXME: Do not use. Will be dissolved. -class PROJECTEXPLORER_EXPORT SimpleRunControl : public RunControl -{ -public: - SimpleRunControl(RunConfiguration *runConfiguration, Core::Id mode); -}; - } // namespace ProjectExplorer diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 265212d39d..8487079b47 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -674,7 +674,9 @@ RunControl *PythonRunControlFactory::create(RunConfiguration *runConfiguration, { Q_UNUSED(errorMessage) QTC_ASSERT(canRun(runConfiguration, mode), return 0); - return new SimpleRunControl(runConfiguration, mode); + auto runControl = new RunControl(runConfiguration, mode); + (void) new SimpleTargetRunner(runControl); + return runControl; } // PythonRunConfigurationWidget diff --git a/src/plugins/qnx/qnxruncontrol.cpp b/src/plugins/qnx/qnxruncontrol.cpp index 9081e3d617..926274c501 100644 --- a/src/plugins/qnx/qnxruncontrol.cpp +++ b/src/plugins/qnx/qnxruncontrol.cpp @@ -39,7 +39,7 @@ namespace Qnx { namespace Internal { QnxRunControl::QnxRunControl(RunConfiguration *runConfig) - : SimpleRunControl(runConfig, ProjectExplorer::Constants::NORMAL_RUN_MODE) + : RunControl(runConfig, ProjectExplorer::Constants::NORMAL_RUN_MODE) , m_slog2Info(0) { IDevice::ConstPtr dev = DeviceKitInformation::device(runConfig->target()->kit()); @@ -60,7 +60,7 @@ QnxRunControl::QnxRunControl(RunConfiguration *runConfig) void QnxRunControl::stop() { m_slog2Info->stop(); - SimpleRunControl::stop(); + RunControl::stop(); } void QnxRunControl::printMissingWarning() diff --git a/src/plugins/qnx/qnxruncontrol.h b/src/plugins/qnx/qnxruncontrol.h index 49b99790ae..a447682101 100644 --- a/src/plugins/qnx/qnxruncontrol.h +++ b/src/plugins/qnx/qnxruncontrol.h @@ -32,7 +32,7 @@ namespace Internal { class Slog2InfoRunner; -class QnxRunControl : public ProjectExplorer::SimpleRunControl +class QnxRunControl : public ProjectExplorer::RunControl { Q_OBJECT public: diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp index b78eaff4c3..a9bb2a0010 100644 --- a/src/plugins/qnx/qnxruncontrolfactory.cpp +++ b/src/plugins/qnx/qnxruncontrolfactory.cpp @@ -124,8 +124,11 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m auto rc = qobject_cast<QnxRunConfiguration *>(runConfig); QTC_ASSERT(rc, return 0); - if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) - return new QnxRunControl(rc); + if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) { + auto runControl = new QnxRunControl(rc); + (void) new SimpleTargetRunner(runControl); + return runControl; + } if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE) { const DebuggerStartParameters params = createDebuggerStartParameters(rc); diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp index 79e6f0ff6c..1e616373db 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp @@ -79,8 +79,11 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Co { QTC_ASSERT(canRun(runConfig, mode), return 0); - if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) - return new SimpleRunControl(runConfig, mode); + if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) { + auto runControl = new RunControl(runConfig, mode); + (void) new SimpleTargetRunner(runControl); + return runControl; + } const auto rcRunnable = runConfig->runnable(); QTC_ASSERT(rcRunnable.is<StandardRunnable>(), return 0); |