From ca38a7a2d3d9dc04136036fa0d8dfc7651101bf4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Fri, 18 Oct 2024 12:51:15 +0200 Subject: [PATCH] ProjectExplorer: Simplify WorkingDirectoryAspect expandProcessArgs has some very specific rules that are not necessary for the build directory, so we use expand(FilePath) instead. Since Environment::expandVariables(FilePath) cleans the path we do not have to call QDir::cleanPath ourselves. Change-Id: Ia08a4abafa00c33ebbc283523051e987c58fa983 Reviewed-by: hjk Reviewed-by: Christian Kandeler --- .../projectexplorer/runconfigurationaspects.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 74d9d2b7b0f..fa6d86a44b9 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -248,13 +248,10 @@ FilePath WorkingDirectoryAspect::workingDirectory() const { const Environment env = m_envAspect ? m_envAspect->environment() : Environment::systemEnvironment(); - QString workingDir = m_workingDirectory.path(); - if (auto expander = macroExpander()) - workingDir = expander->expandProcessArgs(workingDir); - - QString res = workingDir.isEmpty() ? QString() : QDir::cleanPath(env.expandVariables(workingDir)); - - return m_workingDirectory.withNewPath(res); + const FilePath workingDir = macroExpander()->expand(m_workingDirectory); + if (m_envAspect) + return env.expandVariables(workingDir); + return workingDir; } FilePath WorkingDirectoryAspect::defaultWorkingDirectory() const