remove pointless process state checking

this partially reverts ddefe062c7 - contrary to what that commit's
message suggests, the process state doesn't just change out of the blue,
making waitForFinished() return false. that requires the process being
reaped, which may happen only if the event loop runs or one of the
I/O-related waitFor*() functions is called on that process.

note that the first condition in SynchronousProcess::stopProcess() was
actually bogus, as it makes obviously no sense whatsoever to insist that
the process is still running after waitForFinished() returned success.

qtpromaker was also plain broken - it would always terminate prematurely
due to thinking that the sub-process failed.

Change-Id: I44f332a6784ccc7e732ee868e38218f746141129
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen
2020-12-09 12:56:14 +01:00
parent a673fca144
commit fa6d825c5f
11 changed files with 18 additions and 21 deletions

View File

@@ -125,7 +125,7 @@ static FormatTask format(FormatTask task)
}
process.write(task.sourceData.toUtf8());
process.closeWriteChannel();
if (!process.waitForFinished(5000) && process.state() == QProcess::Running) {
if (!process.waitForFinished(5000)) {
process.kill();
task.error = QString(QT_TRANSLATE_NOOP("TextEditor",
"Cannot call %1 or some other error occurred. Timeout "