Replace QtcProcess::stopProcess() by stop() plus waitForFinished

... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-06-16 10:17:33 +02:00
parent bfad59ade0
commit 152b14207c
17 changed files with 34 additions and 26 deletions

View File

@@ -166,8 +166,10 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
proc.setTimeoutS(timeout);
proc.setStdOutCallback([offset, progressQuota, &proc, &assertionFound, &fi](const QString &out) {
int progressPercent = parseProgress(out, assertionFound);
if (assertionFound)
proc.stopProcess();
if (assertionFound) {
proc.stop();
proc.waitForFinished();
}
if (progressPercent != -1)
fi.setProgressValue(offset + qRound((progressPercent / 100.0) * progressQuota));
});
@@ -175,8 +177,10 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
output.stdError = err;
});
if (interruptible) {
QObject::connect(&sdkManager, &AndroidSdkManager::cancelActiveOperations,
&proc, &QtcProcess::stopProcess);
QObject::connect(&sdkManager, &AndroidSdkManager::cancelActiveOperations, &proc, [&proc] {
proc.stop();
proc.waitForFinished();
});
}
proc.setCommand({config.sdkManagerToolPath(), newArgs});
proc.runBlocking(EventLoopMode::On);