diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-01-13 04:25:21 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-01-13 04:25:21 (GMT) |
commit | 4accb53cc2f9e2e89fda91a20e3c0503cf10aad0 (patch) | |
tree | 6281c6967d06a93c06bfcd6ed57d172384d1239b /src/declarative/qml | |
parent | f285a9ec384d880e57f1ea26ccc547043e244bbd (diff) | |
download | Qt-4accb53cc2f9e2e89fda91a20e3c0503cf10aad0.zip Qt-4accb53cc2f9e2e89fda91a20e3c0503cf10aad0.tar.gz Qt-4accb53cc2f9e2e89fda91a20e3c0503cf10aad0.tar.bz2 |
Version "-1" means not-specified.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlcompositetypemanager.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index 22f2df3..9437961 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -461,8 +461,6 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit) int waiting = 0; foreach (QmlScriptParser::Import imp, unit->data.imports()) { - int dot = imp.version.indexOf(QLatin1Char('.')); - if (dot < 0) dot = imp.version.length(); QString qmldir; if (imp.type == QmlScriptParser::Import::File && imp.qualifier.isEmpty()) { QString importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir"))).toString(); @@ -473,8 +471,22 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit) } } } - if (!QmlEnginePrivate::get(engine)->addToImport( - &unit->imports, qmldir, imp.uri, imp.qualifier, imp.version.left(dot).toInt(), imp.version.mid(dot+1).toInt(), imp.type)) + + int vmaj = -1; + int vmin = -1; + if (!imp.version.isEmpty()) { + int dot = imp.version.indexOf(QLatin1Char('.')); + if (dot < 0) { + vmaj = imp.version.toInt(); + vmin = 0; + } else { + vmaj = imp.version.left(dot).toInt(); + vmin = imp.version.mid(dot+1).toInt(); + } + } + + if (!QmlEnginePrivate::get(engine)-> + addToImport(&unit->imports, qmldir, imp.uri, imp.qualifier, vmaj, vmin, imp.type)) { QmlError error; error.setUrl(unit->imports.baseUrl()); |