diff options
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 6d4fba0aa4..10c6c41338 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -730,7 +730,8 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt if (containingType.isValid()) { // we currently cannot reference a Singleton inside itself // in that case, containingType is still invalid - if (int icID = containingType.lookupInlineComponentIdByName(typeStr) != -1) { + int icID = containingType.lookupInlineComponentIdByName(typeStr); + if (icID != -1) { *type_return = containingType.lookupInlineComponentById(icID); } else { auto icType = createICType(); @@ -1408,11 +1409,16 @@ QQmlImports::LocalQmldirResult QQmlImportsPrivate::locateLocalQmldir( if (!absoluteFilePath.isEmpty()) { QString url; const QStringRef absolutePath = absoluteFilePath.leftRef(absoluteFilePath.lastIndexOf(Slash) + 1); - if (absolutePath.at(0) == Colon) + if (absolutePath.at(0) == Colon) { url = QLatin1String("qrc") + absolutePath; - else + } else { url = QUrl::fromLocalFile(absolutePath.toString()).toString(); - + // This handles the UNC path case as when the path is retrieved from the QUrl it + // will convert the host name from upper case to lower case. So the absoluteFilePath + // is changed at this point to make sure it will match later on in that case. + if (absoluteFilePath.startsWith(QLatin1String("//"))) + absoluteFilePath = QUrl::fromLocalFile(absoluteFilePath).toString(QUrl::RemoveScheme); + } QQmlImportDatabase::QmldirCache *cache = new QQmlImportDatabase::QmldirCache; cache->versionMajor = vmaj; cache->versionMinor = vmin; |