diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-08 02:21:44 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-08 02:21:44 (GMT) |
commit | a51eb694a9a43227733dbfc4373779d84d435144 (patch) | |
tree | c10d1065e3dde9a8adaabbb9b6ae4ab8edff897c /src/declarative/qml/qdeclarativeengine.cpp | |
parent | 2f163cda817a3318c293e9a9b9e66fb20f4c990c (diff) | |
download | Qt-a51eb694a9a43227733dbfc4373779d84d435144.zip Qt-a51eb694a9a43227733dbfc4373779d84d435144.tar.gz Qt-a51eb694a9a43227733dbfc4373779d84d435144.tar.bz2 |
Give error if attempt to import from a version that is not installed.
(was done for builtins/plugins, but now also for qmldir-specified content)
Task-number: QTBUG-9627
Diffstat (limited to 'src/declarative/qml/qdeclarativeengine.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index e8b6913..f5fe140 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1620,6 +1620,18 @@ public: url.chop(1); } + if (vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) { + QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin(); + for (; it != qmldircomponents.end(); ++it) { + if (it->majorVersion > vmaj || (it->majorVersion == vmaj && it->minorVersion >= vmin)) + break; + } + if (it == qmldircomponents.end()) { + *errorString = QDeclarativeEngine::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin); + return false; + } + } + s->uris.prepend(uri); s->urls.prepend(url); s->majversions.prepend(vmaj); |