aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-11-28 16:48:16 +0100
committerhjk <hjk@qt.io>2022-11-29 07:28:50 +0000
commita157de7877396b0580d6133d866b3e722844ba7e (patch)
tree7971ca4f99135210d92ba156543258159594c1e7 /src/libs
parent0bd6d7a69fab1cc622f6e00ee63a15c666967e0d (diff)
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 <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/utils/macroexpander.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libs/utils/macroexpander.cpp b/src/libs/utils/macroexpander.cpp
index 85a9ee53aa..0b238c639e 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