aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:02 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-04-07 15:22:02 +0300
commit04ea6df18a2b06efd133a4f1b13c2e38817279ae (patch)
tree73b84355c755c6e21f3f66816aeb13e6a16012cd /src/qml/qml/qqmlimport.cpp
parent4bb06cfba94bcc9ddf30d968a227d00479d475b7 (diff)
parent1089f8f226d546aef3b032a2f4391e08a3afa48d (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.4' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r--src/qml/qml/qqmlimport.cpp14
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;