aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-04-06 11:26:35 +0200
committerhjk <hjk@qt.io>2017-04-06 12:53:57 +0000
commitff62ef3d924c3371727a225cd4fc3b2cd6753a2d (patch)
tree35bccdae9663d04675aeef8bf21bbd7cbfca31a6
parent1ad6c9465c33a271a2cbbafa145c41539c72803b (diff)
ProjectExplorer: Always initialize RunControl's runnable from RunConfig
That's a good first approximation and often enough all that is needed. Change-Id: If54cdb0e98cda94bc4a4ef24fcc12c78018c4dbe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp1
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.cpp1
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp16
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxrunsupport.h9
-rw-r--r--src/plugins/remotelinux/remotelinuxanalyzesupport.cpp2
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp2
-rw-r--r--src/plugins/valgrind/valgrindengine.cpp2
7 files changed, 5 insertions, 28 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 57aae08950..b0f665a661 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -603,6 +603,7 @@ using namespace Internal;
RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) :
d(new RunControlPrivate(this, runConfiguration, mode))
{
+ d->runnable = runConfiguration->runnable();
#ifdef WITH_JOURNALD
JournaldWatcher::instance()->subscribe(this, [this](const JournaldWatcher::LogEntry &entry) {
if (entry.value("_MACHINE_ID") != JournaldWatcher::instance()->machineId())
diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp
index 86fa9ced2a..b78eaff4c3 100644
--- a/src/plugins/qnx/qnxruncontrolfactory.cpp
+++ b/src/plugins/qnx/qnxruncontrolfactory.cpp
@@ -142,7 +142,6 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m
return 0;
RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
QTC_ASSERT(runControl, return 0);
- runControl->setRunnable(runConfig->runnable());
AnalyzerConnection connection;
connection.connParams = device->sshParameters();
connection.analyzerHost = connection.connParams.host;
diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp
index 32bc3ab750..f62e6bf21e 100644
--- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp
+++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.cpp
@@ -41,14 +41,7 @@ namespace Internal {
class AbstractRemoteLinuxRunSupportPrivate
{
public:
- AbstractRemoteLinuxRunSupportPrivate(const RunConfiguration *runConfig)
- : state(AbstractRemoteLinuxRunSupport::Inactive),
- runnable(runConfig->runnable().as<StandardRunnable>())
- {
- }
-
- AbstractRemoteLinuxRunSupport::State state;
- StandardRunnable runnable;
+ AbstractRemoteLinuxRunSupport::State state = AbstractRemoteLinuxRunSupport::Inactive;
ApplicationLauncher appLauncher;
DeviceUsedPortsGatherer portsGatherer;
ApplicationLauncher fifoCreator;
@@ -62,7 +55,7 @@ using namespace Internal;
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RunControl *runControl)
: ToolRunner(runControl),
- d(new AbstractRemoteLinuxRunSupportPrivate(runControl->runConfiguration()))
+ d(new AbstractRemoteLinuxRunSupportPrivate)
{
}
@@ -174,11 +167,6 @@ void AbstractRemoteLinuxRunSupport::createRemoteFifo()
d->fifoCreator.start(r, device());
}
-const StandardRunnable &AbstractRemoteLinuxRunSupport::runnable() const
-{
- return d->runnable;
-}
-
void AbstractRemoteLinuxRunSupport::reset()
{
d->portsGatherer.disconnect(this);
diff --git a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h
index bd89658965..901e970849 100644
--- a/src/plugins/remotelinux/abstractremotelinuxrunsupport.h
+++ b/src/plugins/remotelinux/abstractremotelinuxrunsupport.h
@@ -34,13 +34,6 @@
#include <QObject>
-namespace ProjectExplorer {
-class ApplicationLauncher;
-class RunConfiguration;
-class Runnable;
-class StandardRunnable;
-}
-
namespace RemoteLinux {
namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; }
@@ -78,8 +71,6 @@ protected:
void createRemoteFifo();
QString fifo() const;
- const ProjectExplorer::StandardRunnable &runnable() const;
-
void reset();
protected:
diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp
index bcab0dba6f..24aad94f2c 100644
--- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp
@@ -152,7 +152,7 @@ void RemoteLinuxAnalyzeSupport::startExecution()
connect(runner, &ApplicationLauncher::reportError,
this, &RemoteLinuxAnalyzeSupport::handleAppRunnerError);
- auto r = runnable();
+ auto r = runControl()->runnable().as<StandardRunnable>();
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
if (!r.commandLineArguments.isEmpty())
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 296d325858..5e2443a23e 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -159,7 +159,7 @@ void LinuxDeviceDebugSupport::startExecution()
Runnable LinuxDeviceDebugSupport::realRunnable() const
{
- StandardRunnable r = runnable();
+ StandardRunnable r = runControl()->runnable().as<StandardRunnable>();
QStringList args = QtcProcess::splitArgs(r.commandLineArguments, OsTypeLinux);
QString command;
diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
index 8c56bd782c..0ebbac6d2d 100644
--- a/src/plugins/valgrind/valgrindengine.cpp
+++ b/src/plugins/valgrind/valgrindengine.cpp
@@ -57,8 +57,6 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
: RunControl(runConfiguration, runMode)
{
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
- QTC_ASSERT(runConfiguration, return);
- setRunnable(runConfiguration->runnable());
if (runConfiguration)
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))