From 62aa35ee391ed95b3c0eb857f74d07cbcb0d8f20 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 1 Feb 2024 11:04:31 +0100 Subject: 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 --- src/plugins/qtsupport/qtoutputformatter.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'src/plugins/qtsupport/qtoutputformatter.cpp') diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index d1dcc59db43..13b6d543131 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 { - 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 -- cgit v1.2.3