ProjectExplorer: Clean up IOutputParser interface

- Remove unneeded/unused functions.
- De-virtualize where possible.

In particular, after untangling a number of self-referential
redirections, it became apparent that the outputAdded()
infrastructure was entirely unused.

Change-Id: I51e1beed008df2727b42494b087efa476342397e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-03-31 11:55:48 +02:00
parent cced9c95ea
commit cddaecfe21
15 changed files with 39 additions and 141 deletions

View File

@@ -134,11 +134,6 @@ void CustomParser::stdOutput(const QString &line)
IOutputParser::stdOutput(line);
}
void CustomParser::setWorkingDirectory(const QString &workingDirectory)
{
m_workingDirectory = workingDirectory;
}
void CustomParser::setSettings(const CustomParserSettings &settings)
{
m_error = settings.error;
@@ -152,10 +147,9 @@ Core::Id CustomParser::id()
FilePath CustomParser::absoluteFilePath(const QString &filePath) const
{
if (m_workingDirectory.isEmpty())
if (workingDirectory().isEmpty())
return FilePath::fromUserInput(filePath);
return FilePath::fromString(m_workingDirectory).resolvePath(filePath);
return workingDirectory().resolvePath(filePath);
}
bool CustomParser::hasMatch(const QString &line, CustomParserExpression::CustomParserChannel channel,
@@ -481,7 +475,7 @@ void ProjectExplorerPlugin::testCustomOutputParsers()
CustomParser *parser = new CustomParser;
parser->setSettings(settings);
parser->setWorkingDirectory(workDir);
parser->setWorkingDirectory(FilePath::fromString(workDir));
OutputParserTester testbench;
testbench.appendOutputParser(parser);