From a157de7877396b0580d6133d866b3e722844ba7e Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 28 Nov 2022 16:48:16 +0100 Subject: [PATCH] Utils: Fix expansion of macros in FilePath In the New Project wizards, we do have e.g. %{ProFile} that should expand to {scheme}://{device}//{path-to-pro}, not to {}://{}//{schemedevicepath-to-pro} or similar. Task-number: QTCREATORBUG-28355 Change-Id: Idbad709f3fce583f21186a1d43f27ecac15be2ea Reviewed-by: Qt CI Bot Reviewed-by: Christian Stenger --- src/libs/utils/macroexpander.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/macroexpander.cpp b/src/libs/utils/macroexpander.cpp index 85a9ee53aa3..0b238c639e9 100644 --- a/src/libs/utils/macroexpander.cpp +++ b/src/libs/utils/macroexpander.cpp @@ -272,10 +272,8 @@ QString MacroExpander::expand(const QString &stringWithVariables) const FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const { - return FilePath::fromParts( - expand(fileNameWithVariables.scheme().toString()), - expand(fileNameWithVariables.host().toString()), - expand(fileNameWithVariables.path())); + // We want single variables to expand to fully qualified strings. + return FilePath::fromString(expand(fileNameWithVariables.toString())); } QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const