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>
This commit is contained in:
hjk
2024-02-01 11:04:31 +01:00
parent 8499240544
commit 62aa35ee39
10 changed files with 80 additions and 105 deletions

View File

@@ -43,7 +43,6 @@ QObject *pluginInstance()
class PythonPluginPrivate
{
public:
PythonOutputFormatterFactory outputFormatterFactory;
PythonRunConfigurationFactory runConfigFactory;
PySideBuildStepFactory buildStepFactory;
PythonBuildConfigurationFactory buildConfigFactory;
@@ -77,6 +76,8 @@ private:
setupPythonEditorFactory(this);
setupPythonOutputParser();
KitManager::setIrrelevantAspects(KitManager::irrelevantAspects()
+ QSet<Id>{PythonKitAspect::id()});

View File

@@ -189,12 +189,12 @@ PythonRunConfigurationFactory::PythonRunConfigurationFactory()
addSupportedProjectType(PythonProjectId);
}
PythonOutputFormatterFactory::PythonOutputFormatterFactory()
void setupPythonOutputParser()
{
setFormatterCreator([](Target *t) -> QList<OutputLineParser *> {
addOutputParserFactory([](Target *t) -> OutputLineParser * {
if (t && t->project()->mimeType() == Constants::C_PY_PROJECT_MIME_TYPE)
return {new PythonOutputLineParser};
return {};
return new PythonOutputLineParser;
return nullptr;
});
}

View File

@@ -17,10 +17,6 @@ public:
PythonRunConfigurationFactory();
};
class PythonOutputFormatterFactory : public ProjectExplorer::OutputFormatterFactory
{
public:
PythonOutputFormatterFactory();
};
void setupPythonOutputParser();
} // Python::Internal