ProjectExplorer: Merge CustomExecutableRunConfiguration::runnable()

... into parent class implementation.
This way, the executable expansion will be done for all sub-classes, the
remote custom run configurations being the most relevant ones.

Task-number: QTCREATORBUG-30925
Change-Id: Id7715d9f60338767c0623fa33749ef18338ae479
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-06-05 13:22:51 +02:00
parent 0fa8047f12
commit 345ae8e4d4
3 changed files with 7 additions and 16 deletions

View File

@@ -49,21 +49,6 @@ bool CustomExecutableRunConfiguration::isEnabled(Id) const
return true;
}
ProcessRunData CustomExecutableRunConfiguration::runnable() const
{
ProcessRunData r;
r.command = commandLine();
r.environment = environment.environment();
r.workingDirectory = workingDir();
if (!r.command.isEmpty()) {
const FilePath expanded = macroExpander()->expand(r.command.executable());
r.command.setExecutable(expanded);
}
return r;
}
QString CustomExecutableRunConfiguration::defaultDisplayName() const
{
if (executable().isEmpty())

View File

@@ -20,7 +20,6 @@ public:
QString defaultDisplayName() const;
private:
Utils::ProcessRunData runnable() const override;
bool isEnabled(Utils::Id) const override;
Tasks checkForIssues() const override;

View File

@@ -425,6 +425,13 @@ ProcessRunData RunConfiguration::runnable() const
r.environment = environmentAspect->environment();
if (m_runnableModifier)
m_runnableModifier(r);
// TODO: Do expansion in commandLine()?
if (!r.command.isEmpty()) {
const FilePath expanded = macroExpander()->expand(r.command.executable());
r.command.setExecutable(expanded);
}
return r;
}