Fix JS script imports with namespaces
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 30 Sep 2013 03:11:47 +0000 (05:11 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 30 Sep 2013 16:21:36 +0000 (18:21 +0200)
Make sure to add the resolved namespaces to the import cache, before later
adding scripts into it.

Change-Id: I41537230c49248c2e6c60623bc5a1fe3d50d76cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/qqmltypeloader.cpp

index 52b42e8..849f0f4 100644 (file)
@@ -2278,6 +2278,10 @@ void QQmlTypeData::compile()
 
     if (m_useNewCompiler) {
         m_compiledData->importCache = new QQmlTypeNameCache;
+
+        foreach (const QString &ns, m_namespaces)
+            m_compiledData->importCache->add(ns);
+
         m_imports.populateCache(m_compiledData->importCache);
         m_compiledData->importCache->addref();