diff options
author | hjk <hjk@qt.io> | 2022-05-11 16:51:46 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-05-20 07:06:10 +0000 |
commit | 8dacb123e0e7194b507e609c1016f8bcc3aaceaa (patch) | |
tree | 7aa8bf5e54ff131a038358f49ec47f76bf140c0f /src/plugins/projectexplorer/runconfiguration.cpp | |
parent | a493970e05affcd33b2d16c07580205a479eb30a (diff) | |
download | qt-creator-8dacb123e0e7194b507e609c1016f8bcc3aaceaa.tar.gz |
Utils: Pass MacroExpander to ArgumentsAspect constructor
In the past we wanted to keep the aspect constructor simple but
it turned out that exceptions were needed and accumulating, so those
are likely here to stay.
By passing also the MacroExpander to the ArgumentsAspect constructor
allows other single-purpose warts like the ProjectConfiguration::doPostInit()
machinery can be removed.
Change-Id: I148b0ca1ab0740270eecd0d3134620de65a86d4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/runconfiguration.cpp')
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 43095c1200..11dc8ef69b 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -209,21 +209,16 @@ RunConfiguration::RunConfiguration(Target *target, Utils::Id id) [this] { return commandLine().executable(); }); - m_commandLineGetter = [target, this] { + m_commandLineGetter = [this] { FilePath executable; if (const auto executableAspect = aspect<ExecutableAspect>()) executable = executableAspect->executable(); QString arguments; if (const auto argumentsAspect = aspect<ArgumentsAspect>()) - arguments = argumentsAspect->arguments(macroExpander()); + arguments = argumentsAspect->arguments(); return CommandLine{executable, arguments, CommandLine::Raw}; }; - - addPostInit([this] { - if (const auto wdAspect = aspect<WorkingDirectoryAspect>()) - wdAspect->setMacroExpander(&m_expander); - }); } RunConfiguration::~RunConfiguration() = default; @@ -280,7 +275,7 @@ AspectContainerData RunConfiguration::aspectData() const { AspectContainerData data; for (BaseAspect *aspect : m_aspects) - data.append(aspect->extractData(&m_expander)); + data.append(aspect->extractData()); return data; } @@ -585,7 +580,6 @@ RunConfiguration *RunConfigurationFactory::create(Target *target) const for (const RunConfiguration::AspectFactory &factory : theAspectFactories) rc->m_aspects.registerAspect(factory(target)); - rc->doPostInit(); return rc; } |