diff options
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 9 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport_p.h | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 6540c1f301..1ac2057b98 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -657,7 +657,6 @@ bool QQmlImportInstance::setQmldirContent(const QString &resolvedUrl, { Q_ASSERT(resolvedUrl.endsWith(Slash)); url = resolvedUrl; - localDirectoryPath = QQmlFile::urlToLocalFileOrQrc(url); qmlDirComponents = qmldir.components(); @@ -834,7 +833,12 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt *type_return = returnType; return returnType.isValid(); } - } else if (!isLibrary && !localDirectoryPath.isEmpty()) { + } else if (!isLibrary) { + // the base path of the import if it's a local file + const QString localDirectoryPath = QQmlFile::urlToLocalFileOrQrc(url); + if (localDirectoryPath.isEmpty()) + return false; + QString qmlUrl; bool exists = false; @@ -1570,7 +1574,6 @@ QQmlImportInstance *QQmlImportsPrivate::addImportToNamespace( QQmlImportInstance *import = new QQmlImportInstance; import->uri = uri; import->url = url; - import->localDirectoryPath = QQmlFile::urlToLocalFileOrQrc(url); import->version = version; import->isLibrary = (type == QV4::CompiledData::Import::ImportLibrary); if (flags & QQmlImports::ImportImplicit) { diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h index 2697832067..7a8e1f9dd4 100644 --- a/src/qml/qml/qqmlimport_p.h +++ b/src/qml/qml/qqmlimport_p.h @@ -79,7 +79,6 @@ struct QQmlImportInstance { QString uri; // e.g. QtQuick QString url; // the base path of the import - QString localDirectoryPath; // the base path of the import if it's a local file QQmlType containingType; // points to the containing type for inline components QTypeRevision version; // the version imported bool isLibrary; // true means that this is not a file import |