ApplicationLauncher: Treat DesktopDevice as local

Treat DesktopDevice and all derived devices as local
in application launcher.

Change-Id: Ie1a025c03f1c96158c67e0c900f89e33ec7c4663
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-02-23 14:41:23 +01:00
parent 10abf43afa
commit 3f259da6d5
4 changed files with 10 additions and 18 deletions

View File

@@ -35,6 +35,7 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/qtcprocess.h> #include <utils/qtcprocess.h>
#include "devicesupport/desktopdevice.h"
#include "devicesupport/deviceprocess.h" #include "devicesupport/deviceprocess.h"
#include "projectexplorer.h" #include "projectexplorer.h"
#include "projectexplorersettings.h" #include "projectexplorersettings.h"
@@ -329,7 +330,7 @@ void ApplicationLauncher::start()
void ApplicationLauncherPrivate::start() void ApplicationLauncherPrivate::start()
{ {
m_isLocal = m_runnable.device.isNull(); m_isLocal = m_runnable.device.isNull() || m_runnable.device.dynamicCast<const DesktopDevice>();
m_exitCode = 0; m_exitCode = 0;
m_exitStatus = QProcess::NormalExit; m_exitStatus = QProcess::NormalExit;

View File

@@ -1243,20 +1243,15 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
if (runnable.command.isEmpty()) { if (runnable.command.isEmpty()) {
reportFailure(RunControl::tr("No executable specified.")); reportFailure(RunControl::tr("No executable specified."));
} else { return;
Runnable runnableWithoutDevice = runnable;
runnableWithoutDevice.device.reset();
m_launcher.setRunnable(runnableWithoutDevice);
m_launcher.start();
} }
} else { } else {
connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted); connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted);
}
Runnable runnableWithDevice = runnable; Runnable runnableWithDevice = runnable;
runnableWithDevice.device = device; runnableWithDevice.device = device;
m_launcher.setRunnable(runnable); m_launcher.setRunnable(runnableWithDevice);
m_launcher.start(); m_launcher.start();
}
} }
void SimpleTargetRunner::stop() void SimpleTargetRunner::stop()

View File

@@ -125,10 +125,7 @@ void CallgrindController::run(Option option)
Runnable controller = m_valgrindRunnable; Runnable controller = m_valgrindRunnable;
controller.command.setExecutable(FilePath::fromString(CALLGRIND_CONTROL_BINARY)); controller.command.setExecutable(FilePath::fromString(CALLGRIND_CONTROL_BINARY));
controller.command.setArguments(QString("%1 %2").arg(toOptionString(option)).arg(m_pid)); controller.command.setArguments(QString("%1 %2").arg(toOptionString(option)).arg(m_pid));
if (m_valgrindRunnable.device
&& m_valgrindRunnable.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
controller.device = m_valgrindRunnable.device; controller.device = m_valgrindRunnable.device;
}
m_controllerProcess->setRunnable(controller); m_controllerProcess->setRunnable(controller);
m_controllerProcess->start(); m_controllerProcess->start();
} }

View File

@@ -135,10 +135,9 @@ bool ValgrindRunner::Private::run()
valgrind.command = cmd; valgrind.command = cmd;
valgrind.workingDirectory = m_debuggee.workingDirectory; valgrind.workingDirectory = m_debuggee.workingDirectory;
valgrind.environment = m_debuggee.environment; valgrind.environment = m_debuggee.environment;
if (m_device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE if (m_device->type() != "DockerDeviceType")
&& m_device->type() != "DockerDeviceType") {
valgrind.device = m_device; valgrind.device = m_device;
}
m_valgrindProcess.setRunnable(valgrind); m_valgrindProcess.setRunnable(valgrind);
m_valgrindProcess.start(); m_valgrindProcess.start();
return true; return true;