ProjectExplorer: Reduce use of Runnable in SimpleTargetRunner

Runnable functionality is nowadays mostly accessed more directly
in QtcProcess and its setup functions.

Change-Id: I2a2b5433aef1d464dc58d5a35069376dee051d57
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-05-23 16:09:43 +02:00
parent ae42604904
commit f79a71df7b
13 changed files with 123 additions and 110 deletions

View File

@@ -25,7 +25,6 @@
#include "qmlprofilerruncontrol.h"
#include "qmlprofilerclientmanager.h"
#include "qmlprofilertool.h"
#include <coreplugin/icore.h>
@@ -236,8 +235,7 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
// In the TCP case, it doesn't hurt either to start the profiler before.
addStartDependency(profiler);
setStarter([this, runControl, profiler, serverUrl] {
Runnable debuggee = runControl->runnable();
setStartModifier([this, profiler, serverUrl] {
QUrl serverUrl = profiler->serverUrl();
QString code;
@@ -251,12 +249,13 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
QString arguments = Utils::ProcessArgs::quoteArg(
QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices, code, true));
if (!debuggee.command.arguments().isEmpty())
arguments += ' ' + debuggee.command.arguments();
Utils::CommandLine cmd = commandLine();
const QString oldArgs = cmd.arguments();
cmd.setArguments(arguments);
cmd.addArgs(oldArgs, Utils::CommandLine::Raw);
setCommandLine(cmd);
debuggee.command.setArguments(arguments);
debuggee.device.reset();
doStart(debuggee);
forceRunOnHost();
});
}