Fix key deployment on Windows

It looks like there is no way of setting a command line
on Windows according to Linux rules when there is no
Linux-associated device.

Workaround it by using ProcessArgs explicitly.

Fixes: QTCREATORBUG-28092
Change-Id: I5ce23d33547993ed7c7733809187027084ff4c3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-08-23 18:57:39 +02:00
parent 8656bafbd4
commit 70343084ba

View File

@@ -119,11 +119,10 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de
args << params.host();
cmd.addArgs(args);
CommandLine execCmd;
execCmd.addArg("exec");
execCmd.addCommandLineAsArgs({"/bin/sh", {"-c", command}}, CommandLine::Raw);
QString execCommandString("exec /bin/sh -c");
ProcessArgs::addArg(&execCommandString, command, OsType::OsTypeLinux);
cmd.addArg(execCommandString);
cmd.addArg(execCmd.arguments());
d->m_process.setCommand(cmd);
SshParameters::setupSshEnvironment(&d->m_process);
d->m_process.start();