summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorplugin.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-09-04 10:36:44 +0200
committerhjk <hjk@qt.io>2018-09-04 12:45:21 +0000
commit4192d7d62fe65b70b9f00f540425ea52bcb68c81 (patch)
treefcb82f3415530d2cd463ae8a89e1e524f1a12a63 /src/plugins/pythoneditor/pythoneditorplugin.cpp
parent2c17fbe8dd9fdc619efdeceeddf68ad68f6dfcc1 (diff)
downloadqt-creator-4192d7d62fe65b70b9f00f540425ea52bcb68c81.tar.gz
ProjectExplorer: Compactify runconfiguration aspect creation
Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index 2417c3e7b6..e64eebd98b 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -250,23 +250,21 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id)
const Environment sysEnv = Environment::systemEnvironment();
const QString exec = sysEnv.searchInPath("python").toString();
- auto interpreterAspect = new InterpreterAspect(this);
+ auto interpreterAspect = addAspect<InterpreterAspect>();
interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter");
interpreterAspect->setLabelText(tr("Interpreter:"));
interpreterAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
interpreterAspect->setHistoryCompleter("PythonEditor.Interpreter.History");
interpreterAspect->setValue(exec.isEmpty() ? "python" : exec);
- addExtraAspect(interpreterAspect);
- auto scriptAspect = new MainScriptAspect(this);
+ auto scriptAspect = addAspect<MainScriptAspect>();
scriptAspect->setSettingsKey("PythonEditor.RunConfiguation.Script");
scriptAspect->setLabelText(tr("Script:"));
scriptAspect->setDisplayStyle(BaseStringAspect::LabelDisplay);
- addExtraAspect(scriptAspect);
- addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()));
- addExtraAspect(new ArgumentsAspect(this));
- addExtraAspect(new TerminalAspect(this));
+ addAspect<LocalEnvironmentAspect>(LocalEnvironmentAspect::BaseEnvironmentModifier());
+ addAspect<ArgumentsAspect>();
+ addAspect<TerminalAspect>();
setOutputFormatter<PythonOutputFormatter>();