diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index a56fe7603c3..e0f200eae8b 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -140,18 +140,11 @@ public: &PerfProfilerTool::onRunControlFinished); PerfDataReader *reader = m_perfParserWorker->reader(); - Process *perfProcess = m_perfRecordWorker->process(); - - if (perfProcess) { - connect(perfProcess, &Process::readyReadStandardError, this, [this, perfProcess] { - appendMessage(QString::fromLocal8Bit(perfProcess->readAllRawStandardError()), - StdErrFormat); - }); - connect(perfProcess, &Process::readyReadStandardOutput, this, [this, reader, perfProcess] { - if (!reader->feedParser(perfProcess->readAllRawStandardOutput())) - reportFailure(Tr::tr("Failed to transfer Perf data to perfparser.")); - }); - } + connect(m_perfRecordWorker, &ProcessRunner::stdOutData, + this, [this, reader](const QByteArray &data) { + if (!reader->feedParser(data)) + reportFailure(Tr::tr("Failed to transfer Perf data to perfparser.")); + }); reportStarted(); } diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 22d0f538ce5..52819edb0a3 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1512,17 +1512,13 @@ void ProcessRunnerPrivate::handleDone() void ProcessRunnerPrivate::handleStandardOutput() { if (m_suppressDefaultStdOutHandling) - return; - - const QString msg = m_process.readAllStandardOutput(); - q->appendMessage(msg, StdOutFormat, false); + emit q->stdOutData(m_process.readAllRawStandardOutput()); + else + q->appendMessage(m_process.readAllStandardOutput(), StdOutFormat, false); } void ProcessRunnerPrivate::handleStandardError() { - if (m_suppressDefaultStdOutHandling) - return; - const QString msg = m_process.readAllStandardError(); q->appendMessage(msg, StdErrFormat, false); } @@ -1709,11 +1705,6 @@ void ProcessRunner::setProcessMode(Utils::ProcessMode processMode) d->m_process.setProcessMode(processMode); } -Process *ProcessRunner::process() const -{ - return &d->m_process; -} - void ProcessRunner::suppressDefaultStdOutHandling() { d->m_suppressDefaultStdOutHandling = true; diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index c2199f88303..60794cb80ff 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -293,11 +293,13 @@ public: void setEnvironment(const Utils::Environment &environment); void setWorkingDirectory(const Utils::FilePath &workingDirectory); void setProcessMode(Utils::ProcessMode processMode); - Utils::Process *process() const; void suppressDefaultStdOutHandling(); void forceRunOnHost(); +signals: + void stdOutData(const QByteArray &data); + private: void start() final; void stop() final;