forked from qt-creator/qt-creator
Revert "Utils: Expand FilePaths per part, not as a full string"
This reverts commite8855f97d5
. Reason for revert: Since no one remembers what potential side effects there may have been, and the commit in general makes "expand" worse. The problem withe8855f97d5
is when "fileNameWithVariables" contains something like "%{ProjectDirectory}", which expands to e.g. `docker://image/some/path`, we cannot rely on "fromParts" to do the right thing. It will write everything into the corresponding slot of a FilePath no matter what the content is, so the "docker://" wil become part of the path, and not be recognized as the scheme. Change-Id: I72aeba0ed6c4a6c9a9e5ecb52b3e8e4043ae5669 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -274,10 +274,7 @@ QString MacroExpander::expand(const QString &stringWithVariables) const
|
|||||||
FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const
|
FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const
|
||||||
{
|
{
|
||||||
// We want single variables to expand to fully qualified strings.
|
// We want single variables to expand to fully qualified strings.
|
||||||
const QString host = expand(fileNameWithVariables.host().toString());
|
return FilePath::fromUserInput(expand(fileNameWithVariables.toString()));
|
||||||
const QString scheme = expand(fileNameWithVariables.scheme().toString());
|
|
||||||
const QString path = expand(fileNameWithVariables.path());
|
|
||||||
return FilePath::fromParts(scheme, host, path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const
|
QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const
|
||||||
|
Reference in New Issue
Block a user