diff options
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index d07b70bb16..7db2821a5d 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -2207,10 +2207,12 @@ void QQmlJSImportVisitor::importFromHost(const QString &path, const QString &pre void QQmlJSImportVisitor::importFromQrc(const QString &path, const QString &prefix, const QQmlJS::SourceLocation &location) { - if (const auto &mapper = m_importer->resourceFileMapper()) { - if (mapper->isFile(path)) { + Q_ASSERT(path.startsWith(u':')); + if (const QQmlJSResourceFileMapper *mapper = m_importer->resourceFileMapper()) { + const auto pathNoColon = path.mid(1); + if (mapper->isFile(pathNoColon)) { const auto entry = m_importer->resourceFileMapper()->entry( - QQmlJSResourceFileMapper::resourceFileFilter(path)); + QQmlJSResourceFileMapper::resourceFileFilter(pathNoColon)); const auto scope = m_importer->importFile(entry.filePath); const QString actualPrefix = prefix.isEmpty() ? QFileInfo(entry.resourcePath).baseName() : prefix; |
