diff options
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir | 1 | ||||
-rw-r--r-- | tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 8d78cc7..cdae172 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1112,7 +1112,7 @@ struct QmlEnginePrivate::ImportedNamespace { } QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml")); QString qmldircontent = qmlDirContent.at(i); - if (vmaj || vmin || !qmldircontent.isEmpty()) { + if (vmaj>=0 || !qmldircontent.isEmpty()) { // Check version file - XXX cache these in QmlEngine! if (qmldircontent.isEmpty()) { QFile qmldir(toLocalFileOrQrc(QUrl(urls.at(i)+QLatin1String("/qmldir")))); diff --git a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir index 30c2d4e..eeb9a05 100644 --- a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/qmldir @@ -1,3 +1,4 @@ Rectangle 1.5 InstalledTest2.qml InstalledTest 1.4 InstalledTest2.qml InstalledTest 1.0 InstalledTest.qml +InstalledTestTP 0.0 InstalledTest.qml diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index fcf5d0b..3b7c298 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -1187,6 +1187,14 @@ void tst_qmllanguage::importsInstalled_data() QTest::addColumn<QString>("type"); // import installed + QTest::newRow("installed import 0") + << "import com.nokia.installedtest 0.0\n" + "InstalledTestTP {}" + << "QmlGraphicsRectangle"; + QTest::newRow("installed import 0 as TP") + << "import com.nokia.installedtest 0.0 as TP\n" + "TP.InstalledTestTP {}" + << "QmlGraphicsRectangle"; QTest::newRow("installed import 1") << "import com.nokia.installedtest 1.0\n" "InstalledTest {}" |