Utils: Make QtcProcess::{setW,w}orkingDirectory use FilePath

But keep the old setter for a while to ease transition.

Change-Id: If02b79b1fcd31fbf8b06ef26876c41af891127f9
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2021-06-03 10:39:15 +02:00
parent c956d02200
commit accb1e6e08
10 changed files with 35 additions and 20 deletions

View File

@@ -718,16 +718,16 @@ QByteArray DockerDevice::fileContents(const FilePath &filePath, int limit) const
void DockerDevice::runProcess(QtcProcess &process) const
{
const QString origWd = process.workingDirectory();
const FilePath workingDir = process.workingDirectory();
const CommandLine origCmd = process.commandLine();
CommandLine cmd{"docker", {"exec"}};
cmd.addArgs({"-w", process.workingDirectory()});
cmd.addArgs({"-w", workingDir.path()});
cmd.addArg(d->m_container);
cmd.addArg(origCmd.executable().path()); // Cut off the docker://.../ bits.
cmd.addArgs(origCmd.splitArguments(osType()));
LOG("Run" << cmd.toUserOutput());
LOG("Run" << cmd.toUserOutput() << " in " << workingDir.toUserOutput());
process.setCommand(cmd);
process.start();