Fix incorrect cache indexes when consecutive list items are removed.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Fri, 14 Oct 2011 06:44:46 +0000 (16:44 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 2 Nov 2011 02:52:25 +0000 (03:52 +0100)
commit1c394490f4efe6055426257a8dfcec4cdf3e12af
tree029ccee9a19bf225dd148b347d52472f3c2f9ba8
parentc177691118e4e2bace9b5c1f4f57343190e6ad64
Fix incorrect cache indexes when consecutive list items are removed.

When cached model items are removed listItemsRemoved will try and append
a new cache only range onto a preceding one where possible. Previously
it would then re-run that range so the current indexes in the list were
incremented before moving onto the next range, which meant that the
current indexes were incremented by size of the previous range twice.

Instead of processing the range a second time increment the cache
indexes directly when inserting a cache only range and move directly
onto the next range in the list.

Change-Id: I63418c4397f911cefb521c5a5b0dd25faf66e08b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/util/qdeclarativelistcompositor.cpp
src/declarative/util/qdeclarativelistcompositor_p.h
tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp