┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kcategorizedview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kcategorizedview.cpp')
-rw-r--r--src/kcategorizedview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp
index d250c42c9..b07774157 100644
--- a/src/kcategorizedview.cpp
+++ b/src/kcategorizedview.cpp
@@ -83,7 +83,6 @@ KCategorizedView::Private::Private(KCategorizedView *listView)
, isDragging(false)
, dragLeftViewport(false)
, proxyModel(0)
- , lastIndex(QModelIndex())
{
}
@@ -388,6 +387,9 @@ void KCategorizedView::Private::drawNewCategory(const QModelIndex &index,
void KCategorizedView::Private::updateScrollbars()
{
+ // find the last index in the last category
+ QModelIndex lastIndex = categoriesIndexes.isEmpty() ? QModelIndex() : categoriesIndexes[categories.last()].last();
+
int lastItemBottom = cachedRectIndex(lastIndex).top() +
listView->spacing() + (listView->gridSize().isEmpty() ? 0 : listView->gridSize().height()) - listView->viewport()->height();
@@ -1243,8 +1245,6 @@ void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent,
qStableSort(indexList.begin(), indexList.end(), categoryLessThan);
}
- d->lastIndex = d->categoriesIndexes[d->categories[d->categories.count() - 1]][d->categoriesIndexes[d->categories[d->categories.count() - 1]].count() - 1];
-
// Finally, fill data information of items situation. This will help when
// trying to compute an item place in the viewport
int i = 0; // position relative to the category beginning