summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorplugin.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-04-25 10:26:08 +0200
committerhjk <hjk@qt.io>2018-04-25 15:06:11 +0000
commit366be94ad9edf4c7b15edd9e9af981b857631385 (patch)
tree0f77be5679d35eedf54480011a1394b01cf9ea8f /src/plugins/pythoneditor/pythoneditorplugin.cpp
parent4146a9859907c561864bfbd412d8b65ed69216ad (diff)
downloadqt-creator-366be94ad9edf4c7b15edd9e9af981b857631385.tar.gz
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 <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp11
1 files changed, 4 insertions, 7 deletions
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<PythonRunConfiguration>(PythonRunConfigurationPrefix);
+ registerRunConfiguration<PythonRunConfiguration>("PythonEditor.RunConfiguration.");
addSupportedProjectType(PythonProjectId);
}
};