aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-01-08 14:51:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 21:13:51 +0100
commit375ebc57ac6401d09818e6aa4ea7d6324dbe93a6 (patch)
treec6cbe21dbe3b620e1b712a82eb11f4f4db491f57 /src/qml/jsruntime/qv4qobjectwrapper.cpp
parenta7431e41128bd3aa272223746a5bb57597a87de3 (diff)
Don't return a Property pointer in Object::advanceIterator
Change-Id: Iac4cb2a2252b18e40455910e51e3e374df7c1e80 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index bad2cf3cd4..17673fcfb6 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -700,36 +700,33 @@ PropertyAttributes QObjectWrapper::query(const Managed *m, StringRef name)
return QV4::Object::query(m, name);
}
-Property *QObjectWrapper::advanceIterator(Managed *m, ObjectIterator *it, StringRef name, uint *index, PropertyAttributes *attributes)
+void QObjectWrapper::advanceIterator(Managed *m, ObjectIterator *it, StringRef name, uint *index, Property *p, PropertyAttributes *attributes)
{
name = (String *)0;
*index = UINT_MAX;
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
- if (!that->m_object)
- return QV4::Object::advanceIterator(m, it, name, index, attributes);
-
- const QMetaObject *mo = that->m_object->metaObject();
- const int propertyCount = mo->propertyCount();
- if (it->arrayIndex < static_cast<uint>(propertyCount)) {
- name = that->engine()->newString(QString::fromUtf8(mo->property(it->arrayIndex).name()));
- ++it->arrayIndex;
- if (attributes)
+ if (that->m_object) {
+ const QMetaObject *mo = that->m_object->metaObject();
+ const int propertyCount = mo->propertyCount();
+ if (it->arrayIndex < static_cast<uint>(propertyCount)) {
+ name = that->engine()->newString(QString::fromUtf8(mo->property(it->arrayIndex).name()));
+ ++it->arrayIndex;
*attributes = QV4::Attr_Data;
- it->tmpDynamicProperty.value = that->get(name);
- return &it->tmpDynamicProperty;
- }
- const int methodCount = mo->methodCount();
- if (it->arrayIndex < static_cast<uint>(propertyCount + methodCount)) {
- name = that->engine()->newString(QString::fromUtf8(mo->method(it->arrayIndex - propertyCount).name()));
- ++it->arrayIndex;
- if (attributes)
+ p->value = that->get(name);
+ return;
+ }
+ const int methodCount = mo->methodCount();
+ if (it->arrayIndex < static_cast<uint>(propertyCount + methodCount)) {
+ name = that->engine()->newString(QString::fromUtf8(mo->method(it->arrayIndex - propertyCount).name()));
+ ++it->arrayIndex;
*attributes = QV4::Attr_Data;
- it->tmpDynamicProperty.value = that->get(name);
- return &it->tmpDynamicProperty;
+ p->value = that->get(name);
+ return;
+ }
}
- return QV4::Object::advanceIterator(m, it, name, index, attributes);
+ QV4::Object::advanceIterator(m, it, name, index, p, attributes);
}
namespace QV4 {