ProjectExplorer: Let IOutputParser handle newlines

This makes IOutputParser structurally more similar to
Utils::OutputFormatter, which makes it simpler to explore possibilities
of somehow uniting these two related classes.

Task-number: QTCREATORBUG-22665
Change-Id: Ibb12ab6c8c785d863b9a921102a929864d0a5251
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-03-31 14:34:08 +02:00
parent 45e7b78dc3
commit b15d1951a2
8 changed files with 138 additions and 118 deletions

View File

@@ -140,9 +140,9 @@ static void parse(QFutureInterface<void> &future, const QString &output,
{
const QStringList lines = output.split('\n');
future.setProgressRange(0, lines.count());
const auto parserFunc = isStderr ? &IOutputParser::stdError : &IOutputParser::stdOutput;
const auto parserFunc = isStderr ? &IOutputParser::handleStderr : &IOutputParser::handleStdout;
for (const QString &line : lines) {
(parser.get()->*parserFunc)(line);
(parser.get()->*parserFunc)(line + '\n');
future.setProgressValue(future.progressValue() + 1);
if (future.isCanceled())
return;