aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/qtoutputformatter.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2024-02-01 11:04:31 +0100
committerhjk <hjk@qt.io>2024-02-01 13:23:35 +0000
commit62aa35ee391ed95b3c0eb857f74d07cbcb0d8f20 (patch)
treeda195176961deb52add5ec34912b507790112d82 /src/plugins/qtsupport/qtoutputformatter.cpp
parent84992405440183a401a92f27d3ac3dd73322e8e1 (diff)
ProjectExplorer: Remove OutputFormatterFactory hierarchy
It never gained traction, was only used in thee places, and the class(-hierarchy) is not really needed and only complicates the code when the formatter creation is handled in free functions. Also adapt the users. Change-Id: Ieef7199f5a36f244b2f38cffef71a5fe0606065c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/qtoutputformatter.cpp')
-rw-r--r--src/plugins/qtsupport/qtoutputformatter.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp
index d1dcc59db4..13b6d54313 100644
--- a/src/plugins/qtsupport/qtoutputformatter.cpp
+++ b/src/plugins/qtsupport/qtoutputformatter.cpp
@@ -218,24 +218,18 @@ void QtOutputLineParser::updateProjectFileList()
d->projectFinder.setProjectFiles(d->project->files(Project::SourceFiles));
}
-// QtOutputFormatterFactory
-
-class QtOutputFormatterFactory final : public OutputFormatterFactory
-{
-public:
- QtOutputFormatterFactory()
- {
- setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
- if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
- return {new QtTestParser, new QtOutputLineParser(t)};
- return {};
- });
- }
-};
-
void setupQtOutputFormatter()
{
- static QtOutputFormatterFactory theQtOutputFormatterFactory;
+ addOutputParserFactory([](Target *t) -> OutputLineParser * {
+ if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
+ return new QtTestParser;
+ return nullptr;
+ });
+ addOutputParserFactory([](Target *t) -> OutputLineParser * {
+ if (QtKitAspect::qtVersion(t ? t->kit() : nullptr))
+ return new QtOutputLineParser(t);
+ return nullptr;
+ });
}
} // QtSupport::Internal