From 366be94ad9edf4c7b15edd9e9af981b857631385 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 25 Apr 2018 10:26:08 +0200 Subject: Pass id to RunConfiguration constructor It's what the base class requires, and opens the possibility to have several factories creating the same type of run configuration. Also move ios, winrt and android factories closer to their products, it's the predominant pattern nowadays. Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077 Reviewed-by: Christian Kandeler --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp') diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index c5aa2e1eb8..aabe9e9bc3 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -75,7 +75,6 @@ using namespace Utils; namespace PythonEditor { namespace Internal { -const char PythonRunConfigurationPrefix[] = "PythonEditor.RunConfiguration."; const char InterpreterKey[] = "PythonEditor.RunConfiguation.Interpreter"; const char MainScriptKey[] = "PythonEditor.RunConfiguation.MainScript"; const char PythonMimeType[] = "text/x-python-project"; // ### FIXME @@ -235,7 +234,7 @@ class PythonRunConfiguration : public RunConfiguration Q_PROPERTY(QString arguments READ arguments) public: - explicit PythonRunConfiguration(Target *target); + PythonRunConfiguration(Target *target, Core::Id id); QWidget *createConfigurationWidget() override; QVariantMap toMap() const override; @@ -250,8 +249,6 @@ public: void setInterpreter(const QString &interpreter) { m_interpreter = interpreter; } private: - friend class ProjectExplorer::RunConfigurationFactory; - QString defaultDisplayName() const; QString m_interpreter; @@ -260,8 +257,8 @@ private: //////////////////////////////////////////////////////////////// -PythonRunConfiguration::PythonRunConfiguration(Target *target) - : RunConfiguration(target, PythonRunConfigurationPrefix) +PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id) + : RunConfiguration(target, id) { addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier())); addExtraAspect(new ArgumentsAspect(this, "PythonEditor.RunConfiguration.Arguments")); @@ -351,7 +348,7 @@ class PythonRunConfigurationFactory : public RunConfigurationFactory public: PythonRunConfigurationFactory() { - registerRunConfiguration(PythonRunConfigurationPrefix); + registerRunConfiguration("PythonEditor.RunConfiguration."); addSupportedProjectType(PythonProjectId); } }; -- cgit v1.2.1