forked from qt-creator/qt-creator
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:
@@ -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()});
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@ public:
|
||||
PythonRunConfigurationFactory();
|
||||
};
|
||||
|
||||
class PythonOutputFormatterFactory : public ProjectExplorer::OutputFormatterFactory
|
||||
{
|
||||
public:
|
||||
PythonOutputFormatterFactory();
|
||||
};
|
||||
void setupPythonOutputParser();
|
||||
|
||||
} // Python::Internal
|
||||
|
||||
Reference in New Issue
Block a user