ProjectExplorer: Compactify runconfiguration aspect creation

Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-09-04 10:36:44 +02:00
parent 2c17fbe8dd
commit 4192d7d62f
17 changed files with 68 additions and 88 deletions

View File

@@ -111,28 +111,25 @@ void BaseStringListAspect::setLabel(const QString &label)
AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id) AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
addExtraAspect(new AndroidRunEnvironmentAspect(this)); addAspect<AndroidRunEnvironmentAspect>();
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
auto amStartArgsAspect = new BaseStringAspect(this); auto amStartArgsAspect = addAspect<BaseStringAspect>();
amStartArgsAspect->setId(Constants::ANDROID_AMSTARTARGS); amStartArgsAspect->setId(Constants::ANDROID_AMSTARTARGS);
amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey"); amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey");
amStartArgsAspect->setLabelText(tr("Activity manager start options:")); amStartArgsAspect->setLabelText(tr("Activity manager start options:"));
amStartArgsAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); amStartArgsAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
amStartArgsAspect->setHistoryCompleter("Android.AmStartArgs.History"); amStartArgsAspect->setHistoryCompleter("Android.AmStartArgs.History");
addExtraAspect(amStartArgsAspect);
auto preStartShellCmdAspect = new BaseStringListAspect(this); auto preStartShellCmdAspect = addAspect<BaseStringListAspect>();
preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST); preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST);
preStartShellCmdAspect->setSettingsKey("Android.PreStartShellCmdListKey"); preStartShellCmdAspect->setSettingsKey("Android.PreStartShellCmdListKey");
preStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device before application launch.")); preStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device before application launch."));
addExtraAspect(preStartShellCmdAspect);
auto postStartShellCmdAspect = new BaseStringListAspect(this); auto postStartShellCmdAspect = addAspect<BaseStringListAspect>();
postStartShellCmdAspect->setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST); postStartShellCmdAspect->setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey"); postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey");
postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits.")); postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits."));
addExtraAspect(postStartShellCmdAspect);
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();
connect(target->project(), &Project::parsingFinished, this, [this] { connect(target->project(), &Project::parsingFinished, this, [this] {

View File

@@ -41,16 +41,15 @@ namespace Internal {
BareMetalCustomRunConfiguration::BareMetalCustomRunConfiguration(Target *target, Core::Id id) BareMetalCustomRunConfiguration::BareMetalCustomRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto exeAspect = new ExecutableAspect(this); auto exeAspect = addAspect<ExecutableAspect>();
exeAspect->setSettingsKey("BareMetal.CustomRunConfig.Executable"); exeAspect->setSettingsKey("BareMetal.CustomRunConfig.Executable");
exeAspect->setPlaceHolderText(tr("Unknown")); exeAspect->setPlaceHolderText(tr("Unknown"));
exeAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); exeAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
exeAspect->setHistoryCompleter("BareMetal.CustomRunConfig.History"); exeAspect->setHistoryCompleter("BareMetal.CustomRunConfig.History");
exeAspect->setExpectedKind(PathChooser::Any); exeAspect->setExpectedKind(PathChooser::Any);
addExtraAspect(exeAspect);
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName(tr("Custom Executable"), target)); setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName(tr("Custom Executable"), target));
} }

View File

@@ -43,13 +43,12 @@ namespace Internal {
BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target, Core::Id id) BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto exeAspect = new ExecutableAspect(this); auto exeAspect = addAspect<ExecutableAspect>();
exeAspect->setDisplayStyle(BaseStringAspect::LabelDisplay); exeAspect->setDisplayStyle(BaseStringAspect::LabelDisplay);
exeAspect->setPlaceHolderText(tr("Unknown")); exeAspect->setPlaceHolderText(tr("Unknown"));
addExtraAspect(exeAspect);
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
connect(target, &Target::deploymentDataChanged, connect(target, &Target::deploymentDataChanged,
this, &BareMetalRunConfiguration::updateTargetInformation); this, &BareMetalRunConfiguration::updateTargetInformation);

View File

@@ -53,11 +53,11 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *target, Core::Id id)
if (qt) if (qt)
env.prependOrSetPath(qt->qmakeProperty("QT_INSTALL_BINS")); env.prependOrSetPath(qt->qmakeProperty("QT_INSTALL_BINS"));
}; };
addExtraAspect(new LocalEnvironmentAspect(this, cmakeRunEnvironmentModifier)); addAspect<LocalEnvironmentAspect>(cmakeRunEnvironmentModifier);
addExtraAspect(new ExecutableAspect(this)); addAspect<ExecutableAspect>();
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
connect(target->project(), &Project::parsingFinished, connect(target->project(), &Project::parsingFinished,
this, &CMakeRunConfiguration::updateTargetInformation); this, &CMakeRunConfiguration::updateTargetInformation);

View File

@@ -97,7 +97,7 @@ private:
IosRunConfiguration::IosRunConfiguration(Target *target, Core::Id id) IosRunConfiguration::IosRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();
connect(DeviceManager::instance(), &DeviceManager::updated, connect(DeviceManager::instance(), &DeviceManager::updated,

View File

@@ -44,11 +44,11 @@ namespace Nim {
NimRunConfiguration::NimRunConfiguration(Target *target, Core::Id id) NimRunConfiguration::NimRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
addExtraAspect(new ExecutableAspect(this)); addAspect<ExecutableAspect>();
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier())); addAspect<LocalEnvironmentAspect>(LocalEnvironmentAspect::BaseEnvironmentModifier());
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
setDisplayName(tr("Current Build Target")); setDisplayName(tr("Current Build Target"));
setDefaultDisplayName(tr("Current Build Target")); setDefaultDisplayName(tr("Current Build Target"));

View File

@@ -175,20 +175,18 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe
CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *target, Core::Id id) CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto envAspect = new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()); auto envAspect = addAspect<LocalEnvironmentAspect>(LocalEnvironmentAspect::BaseEnvironmentModifier());
addExtraAspect(envAspect);
auto exeAspect = new ExecutableAspect(this); auto exeAspect = addAspect<ExecutableAspect>();
exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); exeAspect->setSettingsKey("ProjectExplorer.CustomExecutableRunConfiguration.Executable");
exeAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay); exeAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
exeAspect->setHistoryCompleter("Qt.CustomExecutable.History"); exeAspect->setHistoryCompleter("Qt.CustomExecutable.History");
exeAspect->setExpectedKind(PathChooser::ExistingCommand); exeAspect->setExpectedKind(PathChooser::ExistingCommand);
exeAspect->setEnvironment(envAspect->environment()); exeAspect->setEnvironment(envAspect->environment());
addExtraAspect(exeAspect);
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
connect(envAspect, &EnvironmentAspect::environmentChanged, connect(envAspect, &EnvironmentAspect::environmentChanged,
this, [exeAspect, envAspect] { exeAspect->setEnvironment(envAspect->environment()); }); this, [exeAspect, envAspect] { exeAspect->setEnvironment(envAspect->environment()); });

View File

@@ -231,7 +231,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
[this] { return displayName(); }, false); [this] { return displayName(); }, false);
for (const AspectFactory &factory : theAspectFactories) for (const AspectFactory &factory : theAspectFactories)
addExtraAspect(factory(this)); m_aspects.append(factory(this));
} }
RunConfiguration::~RunConfiguration() RunConfiguration::~RunConfiguration()
@@ -280,12 +280,6 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
theAspectFactories.push_back(aspectFactory); theAspectFactories.push_back(aspectFactory);
} }
void RunConfiguration::addExtraAspect(IRunConfigurationAspect *aspect)
{
if (aspect)
m_aspects += aspect;
}
/*! /*!
* Returns the RunConfiguration of the currently active target * Returns the RunConfiguration of the currently active target
* of the startup project, if such exists, or \c nullptr otherwise. * of the startup project, if such exists, or \c nullptr otherwise.

View File

@@ -222,7 +222,13 @@ public:
// The BuildTargetInfo corresponding to the buildKey. // The BuildTargetInfo corresponding to the buildKey.
BuildTargetInfo buildTargetInfo() const; BuildTargetInfo buildTargetInfo() const;
void addExtraAspect(IRunConfigurationAspect *aspect); template<class Aspect, typename ...Args>
Aspect *addAspect(Args && ...args)
{
auto aspect = new Aspect(this, args...);
m_aspects.append(aspect);
return aspect;
}
static RunConfiguration *startupRunConfiguration(); static RunConfiguration *startupRunConfiguration();
virtual bool canRunForNode(const ProjectExplorer::Node *) const { return false; } virtual bool canRunForNode(const ProjectExplorer::Node *) const { return false; }

View File

@@ -250,23 +250,21 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id)
const Environment sysEnv = Environment::systemEnvironment(); const Environment sysEnv = Environment::systemEnvironment();
const QString exec = sysEnv.searchInPath("python").toString(); const QString exec = sysEnv.searchInPath("python").toString();
auto interpreterAspect = new InterpreterAspect(this); auto interpreterAspect = addAspect<InterpreterAspect>();
interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter"); interpreterAspect->setSettingsKey("PythonEditor.RunConfiguation.Interpreter");
interpreterAspect->setLabelText(tr("Interpreter:")); interpreterAspect->setLabelText(tr("Interpreter:"));
interpreterAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay); interpreterAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
interpreterAspect->setHistoryCompleter("PythonEditor.Interpreter.History"); interpreterAspect->setHistoryCompleter("PythonEditor.Interpreter.History");
interpreterAspect->setValue(exec.isEmpty() ? "python" : exec); interpreterAspect->setValue(exec.isEmpty() ? "python" : exec);
addExtraAspect(interpreterAspect);
auto scriptAspect = new MainScriptAspect(this); auto scriptAspect = addAspect<MainScriptAspect>();
scriptAspect->setSettingsKey("PythonEditor.RunConfiguation.Script"); scriptAspect->setSettingsKey("PythonEditor.RunConfiguation.Script");
scriptAspect->setLabelText(tr("Script:")); scriptAspect->setLabelText(tr("Script:"));
scriptAspect->setDisplayStyle(BaseStringAspect::LabelDisplay); scriptAspect->setDisplayStyle(BaseStringAspect::LabelDisplay);
addExtraAspect(scriptAspect);
addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier())); addAspect<LocalEnvironmentAspect>(LocalEnvironmentAspect::BaseEnvironmentModifier());
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
setOutputFormatter<PythonOutputFormatter>(); setOutputFormatter<PythonOutputFormatter>();

View File

@@ -52,26 +52,23 @@ namespace Internal {
QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id) QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto envAspect = new LocalEnvironmentAspect(this, auto envAspect = addAspect<LocalEnvironmentAspect>(
[](RunConfiguration *rc, Environment &env) { [](RunConfiguration *rc, Environment &env) {
static_cast<QbsRunConfiguration *>(rc)->addToBaseEnvironment(env); static_cast<QbsRunConfiguration *>(rc)->addToBaseEnvironment(env);
}); });
addExtraAspect(envAspect);
addExtraAspect(new ExecutableAspect(this)); addAspect<ExecutableAspect>();
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();
auto libAspect = new UseLibraryPathsAspect(this); auto libAspect = addAspect<UseLibraryPathsAspect>();
addExtraAspect(libAspect);
connect(libAspect, &UseLibraryPathsAspect::changed, connect(libAspect, &UseLibraryPathsAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged); envAspect, &EnvironmentAspect::environmentChanged);
if (HostOsInfo::isMacHost()) { if (HostOsInfo::isMacHost()) {
auto dyldAspect = new UseDyldSuffixAspect(this); auto dyldAspect = addAspect<UseDyldSuffixAspect>();
addExtraAspect(dyldAspect);
connect(dyldAspect, &UseDyldSuffixAspect::changed, connect(dyldAspect, &UseDyldSuffixAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged); envAspect, &EnvironmentAspect::environmentChanged);
} }

View File

@@ -63,26 +63,23 @@ const char PRO_FILE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.ProFile";
DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target, Core::Id id) DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto envAspect = new LocalEnvironmentAspect(this, [](RunConfiguration *rc, Environment &env) { auto envAspect = addAspect<LocalEnvironmentAspect>([](RunConfiguration *rc, Environment &env) {
static_cast<DesktopQmakeRunConfiguration *>(rc)->addToBaseEnvironment(env); static_cast<DesktopQmakeRunConfiguration *>(rc)->addToBaseEnvironment(env);
}); });
addExtraAspect(envAspect);
addExtraAspect(new ExecutableAspect(this)); addAspect<ExecutableAspect>();
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new TerminalAspect(this)); addAspect<TerminalAspect>();
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();
auto libAspect = new UseLibraryPathsAspect(this); auto libAspect = addAspect<UseLibraryPathsAspect>();
addExtraAspect(libAspect);
connect(libAspect, &UseLibraryPathsAspect::changed, connect(libAspect, &UseLibraryPathsAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged); envAspect, &EnvironmentAspect::environmentChanged);
if (HostOsInfo::isMacHost()) { if (HostOsInfo::isMacHost()) {
auto dyldAspect = new UseDyldSuffixAspect(this); auto dyldAspect = addAspect<UseDyldSuffixAspect>();
addExtraAspect(dyldAspect);
connect(dyldAspect, &UseLibraryPathsAspect::changed, connect(dyldAspect, &UseLibraryPathsAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged); envAspect, &EnvironmentAspect::environmentChanged);
} }

View File

@@ -55,7 +55,7 @@ const char M_CURRENT_FILE[] = "CurrentFile";
QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
addExtraAspect(new QmlProjectEnvironmentAspect(this)); addAspect<QmlProjectEnvironmentAspect>();
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();
// reset default settings in constructor // reset default settings in constructor

View File

@@ -36,10 +36,9 @@ namespace Internal {
QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id) QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id)
: RemoteLinuxRunConfiguration(target, id) : RemoteLinuxRunConfiguration(target, id)
{ {
auto libAspect = new QtLibPathAspect(this); auto libAspect = addAspect<QtLibPathAspect>();
libAspect->setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); libAspect->setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath");
libAspect->setLabelText(tr("Path to Qt libraries on device")); libAspect->setLabelText(tr("Path to Qt libraries on device"));
addExtraAspect(libAspect);
} }
Runnable QnxRunConfiguration::runnable() const Runnable QnxRunConfiguration::runnable() const

View File

@@ -42,24 +42,22 @@ namespace Internal {
RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target, Core::Id id) RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto exeAspect = new ExecutableAspect(this); auto exeAspect = addAspect<ExecutableAspect>();
exeAspect->setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable"); exeAspect->setSettingsKey("RemoteLinux.CustomRunConfig.RemoteExecutable");
exeAspect->setLabelText(tr("Remote executable:")); exeAspect->setLabelText(tr("Remote executable:"));
exeAspect->setExecutablePathStyle(OsTypeLinux); exeAspect->setExecutablePathStyle(OsTypeLinux);
exeAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); exeAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
exeAspect->setHistoryCompleter("RemoteLinux.CustomExecutable.History"); exeAspect->setHistoryCompleter("RemoteLinux.CustomExecutable.History");
exeAspect->setExpectedKind(PathChooser::Any); exeAspect->setExpectedKind(PathChooser::Any);
addExtraAspect(exeAspect);
auto symbolsAspect = new SymbolFileAspect(this); auto symbolsAspect = addAspect<SymbolFileAspect>();
symbolsAspect->setSettingsKey("RemoteLinux.CustomRunConfig.LocalExecutable"); symbolsAspect->setSettingsKey("RemoteLinux.CustomRunConfig.LocalExecutable");
symbolsAspect->setLabelText(tr("Local executable:")); symbolsAspect->setLabelText(tr("Local executable:"));
symbolsAspect->setDisplayStyle(SymbolFileAspect::PathChooserDisplay); symbolsAspect->setDisplayStyle(SymbolFileAspect::PathChooserDisplay);
addExtraAspect(symbolsAspect);
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new RemoteLinuxEnvironmentAspect(this)); addAspect<RemoteLinuxEnvironmentAspect>();
setDefaultDisplayName(runConfigDefaultDisplayName()); setDefaultDisplayName(runConfigDefaultDisplayName());
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();

View File

@@ -45,23 +45,21 @@ namespace RemoteLinux {
RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::Id id) RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
auto exeAspect = new ExecutableAspect(this); auto exeAspect = addAspect<ExecutableAspect>();
exeAspect->setLabelText(tr("Executable on device:")); exeAspect->setLabelText(tr("Executable on device:"));
exeAspect->setExecutablePathStyle(OsTypeLinux); exeAspect->setExecutablePathStyle(OsTypeLinux);
exeAspect->setPlaceHolderText(tr("Remote path not set")); exeAspect->setPlaceHolderText(tr("Remote path not set"));
exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", exeAspect->makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable",
"RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); "RemoteLinux.RunConfig.UseAlternateRemoteExecutable");
exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); exeAspect->setHistoryCompleter("RemoteLinux.AlternateExecutable.History");
addExtraAspect(exeAspect);
auto symbolsAspect = new SymbolFileAspect(this); auto symbolsAspect = addAspect<SymbolFileAspect>();
symbolsAspect->setLabelText(tr("Executable on host:")); symbolsAspect->setLabelText(tr("Executable on host:"));
symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay); symbolsAspect->setDisplayStyle(SymbolFileAspect::LabelDisplay);
addExtraAspect(symbolsAspect);
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new WorkingDirectoryAspect(this)); addAspect<WorkingDirectoryAspect>();
addExtraAspect(new RemoteLinuxEnvironmentAspect(this)); addAspect<RemoteLinuxEnvironmentAspect>();
setOutputFormatter<QtSupport::QtOutputFormatter>(); setOutputFormatter<QtSupport::QtOutputFormatter>();

View File

@@ -56,8 +56,8 @@ WinRtRunConfiguration::WinRtRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id) : RunConfiguration(target, id)
{ {
setDisplayName(tr("Run App Package")); setDisplayName(tr("Run App Package"));
addExtraAspect(new ArgumentsAspect(this)); addAspect<ArgumentsAspect>();
addExtraAspect(new UninstallAfterStopAspect(this)); addAspect<UninstallAfterStopAspect>();
} }
QWidget *WinRtRunConfiguration::createConfigurationWidget() QWidget *WinRtRunConfiguration::createConfigurationWidget()