QQuickItemView: Add guard before returning currentItem item
authorCaroline Chao <caroline.chao@digia.com>
Tue, 19 Mar 2013 13:01:54 +0000 (14:01 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 19 Mar 2013 18:44:10 +0000 (19:44 +0100)
commit9b25a6f39ee59fe1bb4352a5f2e4ef4a91f1f2c3
treec20b30ae5486a4105b0f2f22bf4fd4c6ce84f3f3
parentea8b11259ad68a8ff44708786ecf54e5a8a272d8
QQuickItemView: Add guard before returning currentItem item

And don't check if the currentItem is empty before calling
applyPendingChanges().

And an autotest. (Patch from Steffen Imhof)

Task-number: QTBUG-30227

Change-Id: Ia16362a6d0dce771f20772929c32e9306ed0e0f9
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/quick/items/qquickitemview.cpp
tests/auto/quick/qquicklistview/data/emptymodel.qml [new file with mode: 0644]
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp