aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python
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/python
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/python')
-rw-r--r--src/plugins/python/pythonplugin.cpp3
-rw-r--r--src/plugins/python/pythonrunconfiguration.cpp8
-rw-r--r--src/plugins/python/pythonrunconfiguration.h6
3 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/python/pythonplugin.cpp b/src/plugins/python/pythonplugin.cpp
index ed0c14c7b19..99334992e49 100644
--- a/src/plugins/python/pythonplugin.cpp
+++ b/src/plugins/python/pythonplugin.cpp
@@ -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()});
diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp
index be7ceb0a5da..3c8c600b0aa 100644
--- a/src/plugins/python/pythonrunconfiguration.cpp
+++ b/src/plugins/python/pythonrunconfiguration.cpp
@@ -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;
});
}
diff --git a/src/plugins/python/pythonrunconfiguration.h b/src/plugins/python/pythonrunconfiguration.h
index 4a2406f4f0b..db5fe71cc03 100644
--- a/src/plugins/python/pythonrunconfiguration.h
+++ b/src/plugins/python/pythonrunconfiguration.h
@@ -17,10 +17,6 @@ public:
PythonRunConfigurationFactory();
};
-class PythonOutputFormatterFactory : public ProjectExplorer::OutputFormatterFactory
-{
-public:
- PythonOutputFormatterFactory();
-};
+void setupPythonOutputParser();
} // Python::Internal