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

@@ -93,8 +93,8 @@ RunResult DeviceShell::run(const CommandLine &cmd, const QByteArray &stdInData)
return RunResult{
proc.exitCode(),
proc.readAllStandardOutput(),
proc.readAllStandardError()
proc.readAllRawStandardOutput(),
proc.readAllRawStandardError()
};
}
@@ -213,7 +213,7 @@ bool DeviceShell::start()
&QtcProcess::readyReadStandardError,
m_shellProcess.get(),
[this] {
const QByteArray stdErr = m_shellProcess->readAllStandardError();
const QByteArray stdErr = m_shellProcess->readAllRawStandardError();
qCWarning(deviceShellLog)
<< "Received unexpected output on stderr:" << stdErr;
});
@@ -249,7 +249,7 @@ bool DeviceShell::checkCommand(const QByteArray &command)
qCWarning(deviceShellLog) << "Timeout while trying to check for" << command;
return false;
}
QByteArray out = m_shellProcess->readAllStandardOutput();
QByteArray out = m_shellProcess->readAllRawStandardOutput();
if (out.contains("<missing>")) {
m_shellScriptState = State::NoScript;
qCWarning(deviceShellLog) << "Command" << command << "was not found";
@@ -293,7 +293,7 @@ bool DeviceShell::installShellScript()
return false;
}
QByteArray out = m_shellProcess->readAllStandardError();
QByteArray out = m_shellProcess->readAllRawStandardError();
if (out.contains("SCRIPT_INSTALLED")) {
m_shellScriptState = State::Succeeded;
return true;
@@ -399,7 +399,7 @@ QList<std::tuple<int, DeviceShell::ParseType, QByteArray>> parseShellOutput(cons
*/
void DeviceShell::onReadyRead()
{
m_commandBuffer += m_shellProcess->readAllStandardOutput();
m_commandBuffer += m_shellProcess->readAllRawStandardOutput();
const qsizetype lastLineEndIndex = m_commandBuffer.lastIndexOf('\n') + 1;
if (lastLineEndIndex == 0)