ProjectExplorer: Normalize DeviceProcess::start() signature

Change-Id: I2915be34d4a1eed64567874dcf0263b7583cc142
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-02-11 17:38:16 +01:00
parent 380d952221
commit 95c9579c58
24 changed files with 107 additions and 109 deletions

View File

@@ -79,7 +79,7 @@ qint64 LinuxDeviceProcess::processId() const
return m_processId < 0 ? 0 : m_processId;
}
QString LinuxDeviceProcess::fullCommandLine(const Runnable &runnable) const
QString LinuxDeviceProcess::fullCommandLine() const
{
CommandLine cmd;
@@ -91,23 +91,22 @@ QString LinuxDeviceProcess::fullCommandLine(const Runnable &runnable) const
cmd.addArgs(";", CommandLine::Raw);
}
if (!runnable.workingDirectory.isEmpty()) {
cmd.addArgs({"cd", runnable.workingDirectory.path()});
if (!workingDirectory().isEmpty()) {
cmd.addArgs({"cd", workingDirectory().path()});
cmd.addArgs("&&", CommandLine::Raw);
}
if (!usesTerminal())
cmd.addArgs(QString("echo ") + pidMarker + "$$" + pidMarker + " && ", CommandLine::Raw);
const Environment &env = runnable.environment;
const Environment &env = environment();
for (auto it = env.constBegin(); it != env.constEnd(); ++it)
cmd.addArgs(env.key(it) + "='" + env.expandedValueForKey(env.key(it)) + '\'', CommandLine::Raw);
if (!usesTerminal())
cmd.addArg("exec");
cmd.addArg(runnable.command.executable().toString());
cmd.addArgs(runnable.command.arguments(), CommandLine::Raw);
cmd.addCommandLineAsArgs(commandLine(), CommandLine::Raw);
return cmd.arguments();
}