Reset the PathView currentIndex to 0 when all items are removed.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Tue, 29 May 2012 05:45:15 +0000 (15:45 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 31 May 2012 00:23:00 +0000 (02:23 +0200)
commit447e5acb880ebda498891623dc4009984cb73bc6
tree870885e9fc51779c81df11c962cb34d01f2253d6
parenta8c137f0e6eabb768f156134b06e022d44993ce2
Reset the PathView currentIndex to 0 when all items are removed.

The default currentIndex for an empty PathView is 0, and except when
there is no model or an empty model setCurrentIndex won't allow a
currentIndex outside the valid index range for the model. This changes
the wrapping for negative numbers in setCurrentIndex so that it is
consistent with decrementCurrentIndex and forces the currentIndex to
0 if there are no model items.

Task-number: QTBUG-21316
Change-Id: Id4d4d78e9832d05baf8a9d148e7f81ee89c9bc61
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickpathview.cpp
tests/auto/quick/qquickpathview/tst_qquickpathview.cpp