From 4192d7d62fe65b70b9f00f540425ea52bcb68c81 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Sep 2018 10:36:44 +0200 Subject: ProjectExplorer: Compactify runconfiguration aspect creation Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82 Reviewed-by: Christian Kandeler --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 12 +++++------- 1 file changed, 5 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 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->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(); 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::BaseEnvironmentModifier()); + addAspect(); + addAspect(); setOutputFormatter(); -- cgit v1.2.1