forked from qt-creator/qt-creator
PE: Get rid of ProcessRunner::process()
Provide stdOutData() signal instead. Change-Id: Ie89c64c67ea383a9f2265bad3b527d3337342656 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user