diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-02 05:41:41 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-02 05:41:41 (GMT) |
commit | ff4140013a993a90ae26cbd56e9d75760ec3e40d (patch) | |
tree | 32aab6ba822029267ed459f8ce9adde0a956d5c0 /src/declarative/qml/qmlscriptparser.cpp | |
parent | baea2c29340b14c6ec1f560a09627f23dd358363 (diff) | |
download | Qt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.zip Qt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.tar.gz Qt-ff4140013a993a90ae26cbd56e9d75760ec3e40d.tar.bz2 |
First conversion to new module handling.
Works same as before for now, but now the variables and methods are
all in the right place. In particular, type resolving is per-component,
not per-engine, even though it is the engine that ultimately has the
ability to find types, because each component will have a different set
of available types.
Designed to be optimizable - QmlEngine could share data between QmlEngine::Import
objects, and the import objects could read types in bulk rather than always searching.
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 7475943..4358a3e 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -463,7 +463,6 @@ bool ProcessAST::visit(AST::UiProgram *node) bool ProcessAST::visit(AST::UiImport *node) { QString fileName = node->fileName->asString(); - _parser->addNamespacePath(fileName); AST::SourceLocation startLoc = node->importToken; AST::SourceLocation endLoc = node->semicolonToken; @@ -471,6 +470,10 @@ bool ProcessAST::visit(AST::UiImport *node) QmlScriptParser::Import import; import.location = location(startLoc, endLoc); import.uri = fileName; + // XXX not used yet... + import.prefix = ""; + import.version_major = 0; + import.version_minor = 0; _parser->_imports << import; @@ -836,11 +839,6 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url) return _errors.isEmpty(); } -QMap<QString,QString> QmlScriptParser::nameSpacePaths() const -{ - return _nameSpacePaths; -} - QStringList QmlScriptParser::types() const { return _typeNames; @@ -867,7 +865,6 @@ void QmlScriptParser::clear() root->release(); root = 0; } - _nameSpacePaths.clear(); _typeNames.clear(); _errors.clear(); @@ -896,9 +893,4 @@ void QmlScriptParser::setTree(Object *tree) root = tree; } -void QmlScriptParser::addNamespacePath(const QString &path) -{ - _nameSpacePaths.insertMulti(QString(), path); -} - QT_END_NAMESPACE |