Replace QScriptBagContainer by QIntrusiveList
authorKent Hansen <kent.hansen@nokia.com>
Thu, 4 Aug 2011 12:19:26 +0000 (14:19 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 11 Aug 2011 08:35:35 +0000 (10:35 +0200)
commit89b694ea15e46461aef5e1695e820582152c67c5
treed94adedcc28c7562ffb1a95989aa6b22b1d376e5
parent038619bf2c5e7d2c18a6f463cd994d8b3831e61f
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>
src/declarative/qml/v8/qjsvalue_impl_p.h
src/declarative/qml/v8/qjsvalue_p.h
src/declarative/qml/v8/qjsvalueiterator_p.h
src/declarative/qml/v8/qscripttools_p.h
src/declarative/qml/v8/qv8engine_impl_p.h
src/declarative/qml/v8/qv8engine_p.h