forked from qt-creator/qt-creator
Utils: Fix readDataFromProcess()
The internal handling of output gets in the way when trying to read output from a process synchronously. Make usage of the internal one instead of relying on the original output handling. Fixes: QTCREATORBUG-25958 Change-Id: Ie96b5e8d17799a613ff15a52a23a8bdc31cb2939 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -540,15 +540,15 @@ bool QtcProcess::readDataFromProcess(int timeoutS,
|
||||
finished = waitForFinished(timeoutS > 0 ? timeoutS * 1000 : -1)
|
||||
|| state() == QProcess::NotRunning;
|
||||
// First check 'stdout'
|
||||
if (d->m_process->bytesAvailable()) { // applies to readChannel() only
|
||||
const QByteArray newStdOut = readAllStandardOutput();
|
||||
if (!newStdOut.isEmpty()) {
|
||||
hasData = true;
|
||||
const QByteArray newStdOut = d->m_process->readAllStandardOutput();
|
||||
if (stdOut)
|
||||
stdOut->append(newStdOut);
|
||||
}
|
||||
// Check 'stderr' separately. This is a special handling
|
||||
// for 'git pull' and the like which prints its progress on stderr.
|
||||
const QByteArray newStdErr = d->m_process->readAllStandardError();
|
||||
const QByteArray newStdErr = readAllStandardError();
|
||||
if (!newStdErr.isEmpty()) {
|
||||
hasData = true;
|
||||
if (stdErr)
|
||||
|
||||
Reference in New Issue
Block a user