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>
This commit is contained in:
Tobias Hunger
2016-04-29 16:52:58 +02:00
parent 1a248b1b93
commit ddefe062c7
38 changed files with 374 additions and 489 deletions

View File

@@ -2159,14 +2159,14 @@ QString ClearCasePlugin::runExtDiff(const QString &workingDir, const QStringList
QStringList args(m_settings.diffArgs.split(QLatin1Char(' '), QString::SkipEmptyParts));
args << arguments;
QProcess process;
SynchronousProcess process;
process.setTimeoutS(timeOutS);
process.setWorkingDirectory(workingDir);
process.start(executable, args);
if (!process.waitForFinished(timeOutS * 1000))
process.setCodec(outputCodec ? outputCodec : QTextCodec::codecForName("UTF-8"));
SynchronousProcessResponse response = process.run(executable, args);
if (response.result != SynchronousProcessResponse::Finished)
return QString();
QByteArray ba = process.readAll();
return outputCodec ? outputCodec->toUnicode(ba) :
QString::fromLocal8Bit(ba.constData(), ba.size());
return response.allOutput();
}
void ClearCasePlugin::syncSlot()