ProjectExplorer: Dissolve the AnsiFilterParser class

This class was different from all the other output parsers in that its
only responsibility was to pre-process the output before it was passed
to the real parsers. We now make this explicit by introducing the
concept of a filter function and turning the AnsiFilterParser class into
one of those.
This also gets rid of a case where the order of output parsers in the
chain matters, which we want to move away from.

Task-number: QTCREATORBUG-22665
Change-Id: Ica135e54ab43cf2ca8186073dc2487c906d4b38d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-04-03 17:22:19 +02:00
parent a03a35d3ea
commit c58b1b2ca6
5 changed files with 53 additions and 51 deletions

View File

@@ -136,10 +136,10 @@ AbstractProcessStep::~AbstractProcessStep()
void AbstractProcessStep::setOutputParser(IOutputParser *parser)
{
d->m_outputParserChain.reset(new AnsiFilterParser);
d->m_outputParserChain->appendOutputParser(parser);
connect(d->m_outputParserChain.get(), &IOutputParser::addTask, this, &AbstractProcessStep::taskAdded);
parser->addFilter(&Internal::filterAnsiEscapeCodes);
d->m_outputParserChain.reset(parser);
connect(d->m_outputParserChain.get(), &IOutputParser::addTask,
this, &AbstractProcessStep::taskAdded);
}
/*!