From 345ae8e4d4e44917f57b3961e4895368b80a3a44 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 5 Jun 2024 13:22:51 +0200 Subject: [PATCH] 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 --- .../customexecutablerunconfiguration.cpp | 15 --------------- .../customexecutablerunconfiguration.h | 1 - src/plugins/projectexplorer/runconfiguration.cpp | 7 +++++++ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 8639bc00cee..12bc39a7c4d 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -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()) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index ced9892c016..3b9e8996b8a 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -20,7 +20,6 @@ public: QString defaultDisplayName() const; private: - Utils::ProcessRunData runnable() const override; bool isEnabled(Utils::Id) const override; Tasks checkForIssues() const override; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index a0c3aa2e6dd..97d467fbc75 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -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; }