diff options
author | hjk <hjk@theqtcompany.com> | 2016-05-03 10:30:56 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-05-04 14:26:36 +0000 |
commit | c813b5f31cde78fd40f5284202820eb759a7cfe2 (patch) | |
tree | 3dbd3109dfb679bb6bdaa0379f5ebf2cb4eca943 /src/plugins | |
parent | 3d96108bbdd68f24665933152379010866011f32 (diff) | |
download | qt-creator-c813b5f31cde78fd40f5284202820eb759a7cfe2.tar.gz |
Make local custom executables run independent of device selection
Task-number: QTCREATORBUG-16199
Change-Id: I1e9e2103e626c6480fa1c5ac9b2b3f8ac93e3038
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/debugger/debuggerruncontrol.cpp | 8 | ||||
-rw-r--r-- | src/plugins/projectexplorer/localapplicationruncontrol.cpp | 12 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runnables.h | 1 | ||||
-rw-r--r-- | src/plugins/qtsupport/customexecutablerunconfiguration.cpp | 2 | ||||
-rw-r--r-- | src/plugins/valgrind/valgrindengine.cpp | 5 |
5 files changed, 23 insertions, 5 deletions
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 0181bd6e4a..9f077c4652 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -598,6 +598,14 @@ public: { if (!(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain)) return false; + + Runnable runnable = runConfig->runnable(); + if (runnable.is<StandardRunnable>()) { + IDevice::ConstPtr device = runnable.as<StandardRunnable>().device; + if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) + return true; + } + return DeviceTypeKitInformation::deviceTypeId(runConfig->target()->kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE || isDebuggableScript(runConfig); diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 02afe6d422..9c20ad71f2 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -138,9 +138,15 @@ static bool isLocal(RunConfiguration *runConfiguration) bool LocalApplicationRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const { - return mode == Constants::NORMAL_RUN_MODE - && isLocal(runConfiguration) - && runConfiguration->runnable().is<StandardRunnable>(); + if (mode != Constants::NORMAL_RUN_MODE) + return false; + const Runnable runnable = runConfiguration->runnable(); + if (!runnable.is<StandardRunnable>()) + return false; + const IDevice::ConstPtr device = runnable.as<StandardRunnable>().device; + if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) + return true; + return isLocal(runConfiguration); } RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) diff --git a/src/plugins/projectexplorer/runnables.h b/src/plugins/projectexplorer/runnables.h index 5e4c94774c..3949b80a0b 100644 --- a/src/plugins/projectexplorer/runnables.h +++ b/src/plugins/projectexplorer/runnables.h @@ -42,6 +42,7 @@ public: QString workingDirectory; Utils::Environment environment; ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui; + IDevice::ConstPtr device; // Override the kit's device. Keep unset by default. }; PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2); diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index c1c79f1e3d..a212866c32 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -33,6 +33,7 @@ #include <projectexplorer/runconfigurationaspects.h> #include <projectexplorer/target.h> #include <projectexplorer/abi.h> +#include <projectexplorer/devicesupport/devicemanager.h> #include <coreplugin/icore.h> @@ -253,6 +254,7 @@ Runnable CustomExecutableRunConfiguration::runnable() const r.workingDirectory = workingDirectory(); r.environment = extraAspect<LocalEnvironmentAspect>()->environment(); r.runMode = extraAspect<TerminalAspect>()->runMode(); + r.device = DeviceManager::instance()->defaultDevice(Constants::DESKTOP_DEVICE_TYPE); return r; } diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 935bc1f243..dde2ae7fd0 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -85,8 +85,9 @@ void ValgrindRunControl::start() ValgrindRunner *run = runner(); run->setValgrindExecutable(m_settings->valgrindExecutable()); run->setValgrindArguments(genericToolArguments() + toolArguments()); - run->setDevice(device()); - run->setDebuggee(runnable().as<StandardRunnable>()); + const StandardRunnable r = runnable().as<StandardRunnable>(); + run->setDevice(r.device ? r.device : device()); + run->setDebuggee(r); connect(run, &ValgrindRunner::processOutputReceived, this, &ValgrindRunControl::receiveProcessOutput); |