aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativemetatype.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-08-23 18:17:51 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-30 13:18:28 +0200
commit7eef3bb9aa6af439f5ac01b3efb20b04d7c8ca62 (patch)
treeb6256910753e85c5853ea3d3c338585461e1df03 /src/declarative/qml/qdeclarativemetatype.cpp
parentf43d20c5ef549e39f1db571e16c35dcb0d55c61b (diff)
Fix the search of QML types.
Stop iterating the multi hash as soon as we find an element with a different key. Change-Id: Ie474708229b4040e66b17ceffc5be787856bc905 Reviewed-on: http://codereview.qt.nokia.com/3799 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativemetatype.cpp')
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index a084bd37df..3bf04b35d4 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -1273,7 +1273,7 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QString &name, int version
QDeclarativeMetaTypeData::Names::ConstIterator it = data->nameToType.find(name);
while (it != data->nameToType.end()) {
// XXX version_major<0 just a kludge for QDeclarativePropertyPrivate::initProperty
- if (version_major<0 || (*it)->availableInVersion(version_major,version_minor))
+ if (it.key() == name && (version_major<0 || (*it)->availableInVersion(version_major,version_minor)))
return (*it);
++it;
}