From 5a46054809b215ed685ce1388309ba947cec4d6f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 8 Feb 2010 11:20:59 +1000 Subject: Fix item removal. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index dafbef8..26be7d8 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -2572,15 +2572,15 @@ void QmlGraphicsListView::itemsRemoved(int modelIndex, int count) d->updateCurrent(qMin(modelIndex, d->model->count()-1)); } - if (removedVisible) { - // update visibleIndex - for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) { - if ((*it)->index != -1) { - d->visibleIndex = (*it)->index; - break; - } + // update visibleIndex + for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) { + if ((*it)->index != -1) { + d->visibleIndex = (*it)->index; + break; } + } + if (removedVisible) { if (d->visibleItems.isEmpty()) { d->visibleIndex = 0; d->visiblePos = d->header ? d->header->size() : 0; -- cgit v0.12