ProjectExplorer: Add a RunConfiguration::setRunnableModifier()

To override RunConfiguration::runnable() behavior without the
need for subclassing. Will be useful for the docker plugin.

Change-Id: I9e8511faa95355038b08c3e3be24429d66a5253f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2021-04-12 17:14:25 +02:00
parent 454e8a31e2
commit f7310dd8fb
2 changed files with 11 additions and 0 deletions

View File

@@ -307,6 +307,11 @@ CommandLine RunConfiguration::commandLine() const
return m_commandLineGetter();
}
void RunConfiguration::setRunnableModifier(const RunnableModifier &runnableModifier)
{
m_runnableModifier = runnableModifier;
}
void RunConfiguration::update()
{
if (m_updater)
@@ -398,6 +403,8 @@ Runnable RunConfiguration::runnable() const
r.workingDirectory = workingDirectoryAspect->workingDirectory(macroExpander()).toString();
if (auto environmentAspect = aspect<EnvironmentAspect>())
r.environment = environmentAspect->environment();
if (m_runnableModifier)
m_runnableModifier(r);
return r;
}