Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*

... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-05 17:55:04 +01:00
parent f08b5727dc
commit 4ddd28ae22
69 changed files with 147 additions and 138 deletions

View File

@@ -1271,7 +1271,7 @@ bool QtcProcess::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int
finished = waitForFinished(timeoutS > 0 ? timeoutS * 1000 : -1)
|| state() == QProcess::NotRunning;
// First check 'stdout'
const QByteArray newStdOut = readAllStandardOutput();
const QByteArray newStdOut = readAllRawStandardOutput();
if (!newStdOut.isEmpty()) {
hasData = true;
if (stdOut)
@@ -1279,7 +1279,7 @@ bool QtcProcess::readDataFromProcess(QByteArray *stdOut, QByteArray *stdErr, int
}
// Check 'stderr' separately. This is a special handling
// for 'git pull' and the like which prints its progress on stderr.
const QByteArray newStdErr = readAllStandardError();
const QByteArray newStdErr = readAllRawStandardError();
if (!newStdErr.isEmpty()) {
hasData = true;
if (stdErr)
@@ -1481,12 +1481,12 @@ bool QtcProcess::waitForFinished(int msecs)
return d->waitForSignal(ProcessSignalType::Done, msecs);
}
QByteArray QtcProcess::readAllStandardOutput()
QByteArray QtcProcess::readAllRawStandardOutput()
{
return d->m_stdOut.readAllData();
}
QByteArray QtcProcess::readAllStandardError()
QByteArray QtcProcess::readAllRawStandardError()
{
return d->m_stdErr.readAllData();
}
@@ -1548,6 +1548,16 @@ void QtcProcess::stop()
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
}
QString QtcProcess::readAllStandardOutput()
{
return QString::fromUtf8(readAllRawStandardOutput());
}
QString QtcProcess::readAllStandardError()
{
return QString::fromUtf8(readAllRawStandardError());
}
/*!
\class Utils::SynchronousProcess