Fix crash in VisualDataModel drag selection example.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Wed, 23 May 2012 04:58:13 +0000 (14:58 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 24 May 2012 02:04:33 +0000 (04:04 +0200)
commit2542778d4837143a61dfcf143c32683acc8b998a
treed8de075e1a1fc65a8a825eacafed928e1723d388
parent5008fc55cf1ab1c776ccd431525fe54b7afeea00
Fix crash in VisualDataModel drag selection example.

The crash was an assert on an invalid pre-condition, and that's simply
been removed.  But it did highlight another issue when moving items
due to separate code paths for iterating forwards and backward in
a composited list.  Basically when iterating backwards because we're
looking for the first instance of an index it's necessary to overshoot
a little to an index prior and then iterate forwards, and as such
there's little difference between iterating forward or backwards.

Change-Id: I6252e3e0170dc2c72d0204137c69275c8ccc519b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/util/qquicklistcompositor.cpp
src/quick/util/qquicklistcompositor_p.h
tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp