forked from qt-creator/qt-creator
ProjectExplorer: Make CustomParser creation available outside PE plugin
This would allow usage from other places, like the CMakeProjectManager plugin. Change-Id: Idf12b6688c9ac3c71b5614dce37babbeab7f6748 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -173,6 +173,15 @@ CustomParsersAspect::CustomParsersAspect(Target *target)
|
||||
});
|
||||
}
|
||||
|
||||
OutputTaskParser *createCustomParserFromId(Utils::Id id)
|
||||
{
|
||||
const CustomParserSettings parser = findOrDefault(ProjectExplorerPlugin::customParsers(),
|
||||
[id](const CustomParserSettings &p) { return p.id == id; });
|
||||
if (parser.id.isValid())
|
||||
return new Internal::CustomParser(parser);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CustomParsersAspect::fromMap(const Store &map)
|
||||
{
|
||||
m_parsers = transform(map.value(settingsKey()).toList(), &Id::fromSetting);
|
||||
@@ -198,15 +207,6 @@ void CustomParser::setSettings(const CustomParserSettings &settings)
|
||||
m_warning = settings.warning;
|
||||
}
|
||||
|
||||
CustomParser *CustomParser::createFromId(Utils::Id id)
|
||||
{
|
||||
const CustomParserSettings parser = findOrDefault(ProjectExplorerPlugin::customParsers(),
|
||||
[id](const CustomParserSettings &p) { return p.id == id; });
|
||||
if (parser.id.isValid())
|
||||
return new CustomParser(parser);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OutputLineParser::Result CustomParser::handleLine(const QString &line, OutputFormat type)
|
||||
{
|
||||
const CustomParserExpression::CustomParserChannel channel = type == StdErrFormat
|
||||
|
||||
Reference in New Issue
Block a user