diff options
author | hjk <hjk@qt.io> | 2018-09-04 10:36:44 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-09-04 12:45:21 +0000 |
commit | 4192d7d62fe65b70b9f00f540425ea52bcb68c81 (patch) | |
tree | fcb82f3415530d2cd463ae8a89e1e524f1a12a63 /src/plugins/projectexplorer/customexecutablerunconfiguration.cpp | |
parent | 2c17fbe8dd9fdc619efdeceeddf68ad68f6dfcc1 (diff) |
ProjectExplorer: Compactify runconfiguration aspect creation
Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/customexecutablerunconfiguration.cpp')
-rw-r--r-- | src/plugins/projectexplorer/customexecutablerunconfiguration.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 42393a23db..708e25477c 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -175,20 +175,18 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *target, Core::Id id) : RunConfiguration(target, id) { - auto envAspect = new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()); - addExtraAspect(envAspect); + auto envAspect = addAspect<LocalEnvironmentAspect>(LocalEnvironmentAspect::BaseEnvironmentModifier()); - auto exeAspect = new ExecutableAspect(this); + auto exeAspect = addAspect<ExecutableAspect>(); exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); exeAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay); exeAspect->setHistoryCompleter("Qt.CustomExecutable.History"); exeAspect->setExpectedKind(PathChooser::ExistingCommand); exeAspect->setEnvironment(envAspect->environment()); - addExtraAspect(exeAspect); - addExtraAspect(new ArgumentsAspect(this)); - addExtraAspect(new WorkingDirectoryAspect(this)); - addExtraAspect(new TerminalAspect(this)); + addAspect<ArgumentsAspect>(); + addAspect<WorkingDirectoryAspect>(); + addAspect<TerminalAspect>(); connect(envAspect, &EnvironmentAspect::environmentChanged, this, [exeAspect, envAspect] { exeAspect->setEnvironment(envAspect->environment()); }); |