From 0945b8d0dce0081ef44ae26e7cba998a887c37a7 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 17 Jun 2021 09:13:52 +0200 Subject: [PATCH] ProjectExplorer: Properly expand variables in remote working directories Change-Id: Ie507a72cac23ef3145ea967eb01f7b8f154c9450 Reviewed-by: David Schulz --- .../projectexplorer/runconfigurationaspects.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 040cc545076..ef0d16e2784 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -246,12 +246,14 @@ void WorkingDirectoryAspect::toMap(QVariantMap &data) const */ FilePath WorkingDirectoryAspect::workingDirectory(const MacroExpander *expander) const { - const Utils::Environment env = m_envAspect ? m_envAspect->environment() - : Utils::Environment::systemEnvironment(); - QString workingDir = m_workingDirectory.toUserOutput(); + const Environment env = m_envAspect ? m_envAspect->environment() + : Environment::systemEnvironment(); + FilePath res = m_workingDirectory; + QString workingDir = m_workingDirectory.path(); if (expander) workingDir = expander->expandProcessArgs(workingDir); - return FilePath::fromString(PathChooser::expandedDirectory(workingDir, env, QString())); + res.setPath(PathChooser::expandedDirectory(workingDir, env, QString())); + return res; } FilePath WorkingDirectoryAspect::defaultWorkingDirectory() const