X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdeclarative%2Fqml%2Fqdeclarativetypenamecache_p.h;h=9cf52f9d72d0a3fb2587f43b693c062c4bdf2c71;hb=45b14259fc0cf704692df1c00da511527d1fba1d;hp=68f6044eef6583786bd0fdf58abd2c16a7d1c07b;hpb=e6b224aa2872d7d1030fa98bd30603e16f8f9604;p=profile%2Fivi%2Fqtdeclarative.git diff --git a/src/declarative/qml/qdeclarativetypenamecache_p.h b/src/declarative/qml/qdeclarativetypenamecache_p.h index 68f6044..9cf52f9 100644 --- a/src/declarative/qml/qdeclarativetypenamecache_p.h +++ b/src/declarative/qml/qdeclarativetypenamecache_p.h @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: http://www.qt-project.org/ ** ** This file is part of the QtDeclarative module of the Qt Toolkit. @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -73,7 +73,7 @@ public: inline bool isEmpty() const; - void add(const QHashedString &, int); + void add(const QHashedString &name, int sciptIndex = -1, const QHashedString &nameSpace = QHashedString()); struct Result { inline Result(); @@ -107,7 +107,35 @@ private: int scriptIndex; }; + template + Result query(const QStringHash &imports, Key key) + { + Import *i = imports.value(key); + if (i) { + if (i->scriptIndex != -1) { + return Result(i->scriptIndex); + } else { + return Result(static_cast(i)); + } + } + + return Result(); + } + + template + Result typeSearch(const QVector &modules, Key key) + { + QVector::const_iterator end = modules.constEnd(); + for (QVector::const_iterator it = modules.constBegin(); it != end; ++it) { + if (QDeclarativeType *type = it->type(key)) + return Result(type); + } + + return Result(); + } + QStringHash m_namedImports; + QMap > m_namespacedImports; QVector m_anonymousImports; QDeclarativeEngine *engine;