Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}

Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-05-17 12:02:42 +02:00
parent 2db9ebc615
commit 90ad902486
40 changed files with 155 additions and 103 deletions

View File

@@ -235,8 +235,8 @@ static QByteArray decodeProvisioningProfile(const QString &path)
Utils::SynchronousProcess p;
p.setTimeoutS(3);
// path is assumed to be valid file path to .mobileprovision
const QStringList args = {"smime", "-inform", "der", "-verify", "-in", path};
p.runBlocking({"openssl", args});
p.setCommand({"openssl", {"smime", "-inform", "der", "-verify", "-in", path}});
p.runBlocking();
if (p.result() != Utils::QtcProcess::Finished)
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
return p.stdOut().toLatin1();

View File

@@ -67,8 +67,8 @@ void XcodeProbe::detectDeveloperPaths()
{
Utils::SynchronousProcess selectedXcode;
selectedXcode.setTimeoutS(5);
const CommandLine xcodeSelect{"/usr/bin/xcode-select", {"--print-path"}};
selectedXcode.run(xcodeSelect);
selectedXcode.setCommand({"/usr/bin/xcode-select", {"--print-path"}});
selectedXcode.run();
if (selectedXcode.result() != QtcProcess::Finished)
qCWarning(probeLog)
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select");

View File

@@ -83,7 +83,8 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
{
SynchronousProcess p;
p.setTimeoutS(-1);
p.runBlocking(command);
p.setCommand(command);
p.runBlocking();
if (stdOutput)
*stdOutput = p.stdOut();
if (allOutput)