Process: Use more rawStd{Out,Err} const methods instead of mutable ones

Avoid using readAllStandard{Output,Error} mutable methods if possible.
Use non-mutable methods when we are not connected to
readyReadStandard{Output,Error} signals.

Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2024-01-21 17:17:46 +01:00
parent 6ed9552be2
commit 290121bc21
25 changed files with 32 additions and 36 deletions

View File

@@ -1892,8 +1892,7 @@ void CMakeBuildSystem::runCTest()
m_ctestProcess->setCommand({m_ctestPath, { "-N", "--show-only=json-v1"}});
connect(m_ctestProcess.get(), &Process::done, this, [this] {
if (m_ctestProcess->result() == ProcessResult::FinishedWithSuccess) {
const QJsonDocument json
= QJsonDocument::fromJson(m_ctestProcess->readAllRawStandardOutput());
const QJsonDocument json = QJsonDocument::fromJson(m_ctestProcess->rawStdOut());
if (!json.isEmpty() && json.isObject()) {
const QJsonObject jsonObj = json.object();
const QJsonObject btGraph = jsonObj.value("backtraceGraph").toObject();