ProjectExplorer: Re-use CommandLine::addCommandLineAsSingleArg()

... for its intended purpose.

Change-Id: Idd3c2888e22f8d1d62902365e55456f043616866
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2024-12-10 13:05:39 +01:00
parent bd0988f327
commit 286512d599

View File

@@ -486,11 +486,11 @@ qint64 SshProcessInterface::processId() const
ProcessResult SshProcessInterface::runInShell(const CommandLine &command, const QByteArray &data)
{
CommandLine cmd{d->m_device->filePath("/bin/sh"), {"-c"}};
cmd.addCommandLineAsSingleArg(command);
Process process;
QString tmp;
ProcessArgs::addArg(&tmp, command.executable().path());
ProcessArgs::addArgs(&tmp, command.arguments());
process.setCommand({d->m_device->filePath("/bin/sh"), {"-c", tmp}});
process.setCommand(cmd);
process.setWriteData(data);
using namespace std::chrono_literals;
process.runBlocking(2s);