summaryrefslogtreecommitdiff
path: root/src/plugins/ios/iosprobe.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-04-29 16:52:58 +0200
committerTobias Hunger <tobias.hunger@qt.io>2016-05-11 10:04:38 +0000
commitddefe062c73e35def585f8fc6c90a4f18e47c0f4 (patch)
tree03c3aecc501c03b92e259fe0ae1c4d472033b7e5 /src/plugins/ios/iosprobe.cpp
parent1a248b1b932e2c7c42e25993d921e78c52aa4bcf (diff)
downloadqt-creator-ddefe062c73e35def585f8fc6c90a4f18e47c0f4.tar.gz
Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at the time of the call. Handle that throughout the codebase. Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094 Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins/ios/iosprobe.cpp')
-rw-r--r--src/plugins/ios/iosprobe.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/ios/iosprobe.cpp b/src/plugins/ios/iosprobe.cpp
index 72069fb91b..47c4e2c7a7 100644
--- a/src/plugins/ios/iosprobe.cpp
+++ b/src/plugins/ios/iosprobe.cpp
@@ -25,6 +25,8 @@
#include "iosprobe.h"
+#include <utils/synchronousprocess.h>
+
#include <QDir>
#include <QFileInfo>
#include <QFileInfoList>
@@ -93,14 +95,16 @@ void IosProbe::addDeveloperPath(const QString &path)
void IosProbe::detectDeveloperPaths()
{
- QProcess selectedXcode;
QString program = QLatin1String("/usr/bin/xcode-select");
QStringList arguments(QLatin1String("--print-path"));
- selectedXcode.start(program, arguments, QProcess::ReadOnly);
- if (!selectedXcode.waitForFinished() || selectedXcode.exitCode()) {
+
+ Utils::SynchronousProcess selectedXcode;
+ selectedXcode.setTimeoutS(5);
+ Utils::SynchronousProcessResponse response = selectedXcode.run(program, arguments);
+ if (response.result != Utils::SynchronousProcessResponse::Finished) {
qCWarning(probeLog) << QString::fromLatin1("Could not detect selected xcode with /usr/bin/xcode-select");
} else {
- QString path = QString::fromLocal8Bit(selectedXcode.readAllStandardOutput());
+ QString path = response.stdOut;
path.chop(1);
addDeveloperPath(path);
}