diff options
author | mae <qt-info@nokia.com> | 2010-03-17 16:38:02 (GMT) |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-03-17 16:38:02 (GMT) |
commit | 4b4e9be3ea5a267c8fc05d6ff5aca972d64eb705 (patch) | |
tree | 63faf798bd2e94308035808708dc10a767e1ce28 /src/declarative | |
parent | 47fb07c9fdf47584ae55f3412102bbeef5576b04 (diff) | |
download | Qt-4b4e9be3ea5a267c8fc05d6ff5aca972d64eb705.zip Qt-4b4e9be3ea5a267c8fc05d6ff5aca972d64eb705.tar.gz Qt-4b4e9be3ea5a267c8fc05d6ff5aca972d64eb705.tar.bz2 |
Another fix to find
Do not try to instantiate types that are explicitely
forbidden in the qmldir (because the version does not match).
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index ce4a9f1..a097b02 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1385,6 +1385,7 @@ struct QDeclarativeEnginePrivate::ImportedNamespace { QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml")); QString qmldircontent = qmlDirContent.at(i); + bool typeWasDeclaredInQmldir = false; if (!qmldircontent.isEmpty()) { const QString typeName = QString::fromUtf8(type); @@ -1394,8 +1395,9 @@ struct QDeclarativeEnginePrivate::ImportedNamespace { qmldirParser.parse(); foreach (const QDeclarativeDirParser::Component &c, qmldirParser.components()) { // ### TODO: cache the components - if (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion)) { - if (c.typeName == typeName) { + if (c.typeName == typeName) { + typeWasDeclaredInQmldir = true; + if (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion)) { if (url_return) *url_return = url.resolved(QUrl(c.fileName)); return true; @@ -1404,7 +1406,7 @@ struct QDeclarativeEnginePrivate::ImportedNamespace { } } - if (!isLibrary.at(i)) { + if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) { // XXX search non-files too! (eg. zip files, see QT-524) QFileInfo f(toLocalFileOrQrc(url)); if (f.exists()) { |