diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-08-04 14:19:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-11 10:35:35 +0200 |
commit | 89b694ea15e46461aef5e1695e820582152c67c5 (patch) | |
tree | d94adedcc28c7562ffb1a95989aa6b22b1d376e5 /src/declarative/qml/v8/qjsvalueiterator_p.h | |
parent | 038619bf2c5e7d2c18a6f463cd994d8b3831e61f (diff) |
Replace QScriptBagContainer by QIntrusiveList
QIntrusiveList effectively does the same as
QScriptBagContainer, without the need to inherit a
Node class. Let's avoid the code duplication.
However, QIntrusiveList::remove() and insert()
are less strict than QScriptBagContainer; introduce
QScriptIntrusiveList that performs the same sanity
checks (no duplicate insertion, etc). Ideally these
checks would be merged into QIntrusiveList.
Also rename QJSValuePrivate::reinitialize() to
invalidate(), and make it not call
engine->unregisterValue(this) any more. Values are
only invalidated at engine destruction time, and
it's the engine's responsibility to erase the list.
Change-Id: I60fc61ee8f90a716a285b1dd1bf4d6a08a9349df
Reviewed-on: http://codereview.qt.nokia.com/2628
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalueiterator_p.h')
-rw-r--r-- | src/declarative/qml/v8/qjsvalueiterator_p.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/declarative/qml/v8/qjsvalueiterator_p.h b/src/declarative/qml/v8/qjsvalueiterator_p.h index d3033d496b..6113d3dd4f 100644 --- a/src/declarative/qml/v8/qjsvalueiterator_p.h +++ b/src/declarative/qml/v8/qjsvalueiterator_p.h @@ -24,16 +24,17 @@ #ifndef QJSVALUEITERATOR_P_H #define QJSVALUEITERATOR_P_H -#include <qscripttools_p.h> -#include <qjsvalue_p.h> +#include <private/qintrusivelist_p.h> +#include "qjsvalue_p.h" -#include <qv8_p.h> +#include <private/qv8_p.h> QT_BEGIN_NAMESPACE class QV8Engine; -class QJSValueIteratorPrivate : public QScriptLinkedNode { +class QJSValueIteratorPrivate +{ public: inline QJSValueIteratorPrivate(const QJSValuePrivate* value); inline ~QJSValueIteratorPrivate(); @@ -52,10 +53,13 @@ public: private: Q_DISABLE_COPY(QJSValueIteratorPrivate) + QIntrusiveListNode m_node; QScriptSharedDataPointer<QJSValuePrivate> m_object; v8::Persistent<v8::Array> m_names; uint32_t m_index; uint32_t m_count; + + friend class QV8Engine; }; |