diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-01 03:51:18 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-01 03:51:18 (GMT) |
commit | 4d523c7cb2d3322c3b4512148b9d34ca5fe34225 (patch) | |
tree | 729e7869aae82e6ce560d42b152593f1dcdb53c9 /src/declarative | |
parent | f78c58d59c1d772aa1a332fc8e90991d242ad273 (diff) | |
parent | e890d1d289a299d8e9734b4d96b58fc9c5e0768d (diff) | |
download | Qt-4d523c7cb2d3322c3b4512148b9d34ca5fe34225.zip Qt-4d523c7cb2d3322c3b4512148b9d34ca5fe34225.tar.gz Qt-4d523c7cb2d3322c3b4512148b9d34ca5fe34225.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativecompositetypemanager.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index c59e5e2..eb8c9eb 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -537,6 +537,31 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData int waiting = 0; + /* + For local urls, add an implicit import "." as first (most overridden) lookup. This will also trigger + the loading of the qmldir and the import of any native types from available plugins. + */ + { + + QDeclarativeDirComponents qmldircomponentsnetwork; + if (QDeclarativeCompositeTypeResource *resource + = resources.value(unit->imports.baseUrl().resolved(QUrl(QLatin1String("./qmldir"))))) { + QDeclarativeDirParser parser; + parser.setSource(QString::fromUtf8(resource->data)); + parser.parse(); + qmldircomponentsnetwork = parser.components(); + } + + QDeclarativeEnginePrivate::get(engine)-> + addToImport(&unit->imports, + qmldircomponentsnetwork, + QLatin1String("."), + QString(), + -1, -1, + QDeclarativeScriptParser::Import::File, + 0); // error ignored (just means no fallback) + } + foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) { QDeclarativeDirComponents qmldircomponentsnetwork; @@ -587,31 +612,6 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData } } - /* - For local urls, add an implicit import "." as first lookup. This will also trigger - the loading of the qmldir and the import of any native types from available plugins. - */ - { - - QDeclarativeDirComponents qmldircomponentsnetwork; - if (QDeclarativeCompositeTypeResource *resource - = resources.value(unit->imports.baseUrl().resolved(QUrl(QLatin1String("./qmldir"))))) { - QDeclarativeDirParser parser; - parser.setSource(QString::fromUtf8(resource->data)); - parser.parse(); - qmldircomponentsnetwork = parser.components(); - } - - QDeclarativeEnginePrivate::get(engine)-> - addToImport(&unit->imports, - qmldircomponentsnetwork, - QLatin1String("."), - QString(), - -1, -1, - QDeclarativeScriptParser::Import::File, - 0); // error ignored (just means no fallback) - } - QList<QDeclarativeScriptParser::TypeReference*> types = unit->data.referencedTypes(); |