aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlcompiler/qqmljsutils.cpp')
-rw-r--r--src/qmlcompiler/qqmljsutils.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsutils.cpp b/src/qmlcompiler/qqmljsutils.cpp
index 7fc31e9524..baa5d7cea0 100644
--- a/src/qmlcompiler/qqmljsutils.cpp
+++ b/src/qmlcompiler/qqmljsutils.cpp
@@ -322,12 +322,13 @@ QString qmlSourcePathFromBuildPath(const QQmlJSResourceFileMapper *mapper,
if (!mapper)
return pathInBuildFolder;
- const auto qmlModuleEntry =
- qmlModuleEntryFromBuildPath(mapper, pathInBuildFolder, LocalFileFilter);
+ // Slice the path the mapper matched against: its entries are absolute and clean.
+ const QString buildPath = QDir::cleanPath(QFileInfo(pathInBuildFolder).absoluteFilePath());
+ const auto qmlModuleEntry = qmlModuleEntryFromBuildPath(mapper, buildPath, LocalFileFilter);
if (!qmlModuleEntry.isValid())
return pathInBuildFolder;
const QString qrcPath = qmlModuleEntry.resourcePath
- + QStringView(pathInBuildFolder).sliced(qmlModuleEntry.filePath.size());
+ + QStringView(buildPath).sliced(qmlModuleEntry.filePath.size());
const auto entry = mapper->entry(QQmlJSResourceFileMapper::resourceFileFilter(qrcPath));
return entry.isValid()? entry.filePath : pathInBuildFolder;