Commit 8c25afbe authored by Daniel Teske's avatar Daniel Teske
Browse files

runUic: Have a timeout on writing and error out if we can't write



Task-Number: QTCREATORBUG-6449

Change-Id: I592c7e925267d538124b96b899c1f8a6bc8d8955
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent dd1f0279
......@@ -148,18 +148,22 @@ bool UiCodeModelSupport::runUic(const QString &ui) const
if (!process.waitForStarted())
return false;
process.write(ui.toUtf8());
if (!process.waitForBytesWritten(3000))
goto error;
process.closeWriteChannel();
if (process.waitForFinished() && process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0) {
m_contents = process.readAllStandardOutput();
m_cacheTime = QDateTime::currentDateTime();
if (debug)
qDebug() << "ok" << m_contents.size() << "bytes.";
return true;
} else {
if (debug)
qDebug() << "failed" << process.readAllStandardError();
process.kill();
}
if (!process.waitForFinished(3000) && process.exitStatus() != QProcess::NormalExit && process.exitCode() != 0)
goto error;
m_contents = process.readAllStandardOutput();
m_cacheTime = QDateTime::currentDateTime();
if (debug)
qDebug() << "ok" << m_contents.size() << "bytes.";
return true;
error:
if (debug)
qDebug() << "failed" << process.readAllStandardError();
process.kill();
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment