aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativetypeloader.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-01-25 14:43:07 +1000
committerMichael Brasser <michael.brasser@nokia.com>2012-01-25 14:43:07 +1000
commitc3601a8db91bc777ea859d6a796dfab6a218675e (patch)
treed2a4f6c83bec3cddcce020966cccac72be3aa04a /src/declarative/qml/qdeclarativetypeloader.cpp
parent35794301d188b731a7b596d92fc632fff58586c0 (diff)
parent149f6afe321ce59aebe4ce2f9dddd1881d0ac22b (diff)
Merge branch 'master' into animation-refactorwip/animation-refactor
Conflicts: tests/auto/declarative/declarative.pro Change-Id: Ie339be2989fac553d351f3077869f1847367b504
Diffstat (limited to 'src/declarative/qml/qdeclarativetypeloader.cpp')
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp
index cbc075dac3..bf319e5387 100644
--- a/src/declarative/qml/qdeclarativetypeloader.cpp
+++ b/src/declarative/qml/qdeclarativetypeloader.cpp
@@ -2,7 +2,7 @@
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
@@ -1427,6 +1427,11 @@ const QList<QDeclarativeTypeData::ScriptReference> &QDeclarativeTypeData::resolv
return m_scripts;
}
+const QSet<QString> &QDeclarativeTypeData::namespaces() const
+{
+ return m_namespaces;
+}
+
QDeclarativeCompiledData *QDeclarativeTypeData::compiledData() const
{
if (m_compiledData)
@@ -1648,6 +1653,27 @@ void QDeclarativeTypeData::resolveTypes()
}
}
+ // Add any imported scripts to our resolved set
+ foreach (const QDeclarativeImports::ScriptReference &script, m_imports.resolvedScripts())
+ {
+ QDeclarativeScriptBlob *blob = typeLoader()->getScript(script.location);
+ addDependency(blob);
+
+ ScriptReference ref;
+ //ref.location = ...
+ ref.qualifier = script.nameSpace;
+ if (!script.qualifier.isEmpty())
+ {
+ ref.qualifier.prepend(script.qualifier + QLatin1Char('.'));
+
+ // Add a reference to the enclosing namespace
+ m_namespaces.insert(script.qualifier);
+ }
+
+ ref.script = blob;
+ m_scripts << ref;
+ }
+
foreach (QDeclarativeScript::TypeReference *parserRef, scriptParser.referencedTypes()) {
TypeReference ref;