X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6d10e57f88d9215e7d0bd810fef6c302b73e08ec..e8bc9f1072bfc43d7605315c8df69f37bfc71cc3:/src/kcategorizedview.cpp diff --git a/src/kcategorizedview.cpp b/src/kcategorizedview.cpp index 24603b98b..4f542f9c7 100644 --- a/src/kcategorizedview.cpp +++ b/src/kcategorizedview.cpp @@ -390,6 +390,8 @@ void KCategorizedView::Private::updateScrollbars() int lastItemBottom = cachedRectIndex(lastIndex).top() + listView->spacing() + (listView->gridSize().isEmpty() ? 0 : listView->gridSize().height()) - listView->viewport()->height(); + listView->horizontalScrollBar()->setRange(0, 0); + listView->verticalScrollBar()->setSingleStep(listView->viewport()->height() / 10); listView->verticalScrollBar()->setPageStep(listView->viewport()->height()); listView->verticalScrollBar()->setRange(0, lastItemBottom); @@ -422,6 +424,7 @@ void KCategorizedView::Private::layoutChanged(bool forceItemReload) (modelSortRole != proxyModel->sortRole()) || (modelSortColumn != proxyModel->sortColumn()) || (modelSortOrder != proxyModel->sortOrder()) || + (modelLastRowCount != proxyModel->rowCount()) || (modelCategorized != proxyModel->isCategorizedModel())))) { // Force the view to update all elements @@ -432,6 +435,7 @@ void KCategorizedView::Private::layoutChanged(bool forceItemReload) modelSortRole = proxyModel->sortRole(); modelSortColumn = proxyModel->sortColumn(); modelSortOrder = proxyModel->sortOrder(); + modelLastRowCount = proxyModel->rowCount(); modelCategorized = proxyModel->isCategorizedModel(); } } @@ -526,6 +530,7 @@ void KCategorizedView::setModel(QAbstractItemModel *model) d->modelSortRole = d->proxyModel->sortRole(); d->modelSortColumn = d->proxyModel->sortColumn(); d->modelSortOrder = d->proxyModel->sortOrder(); + d->modelLastRowCount = d->proxyModel->rowCount(); d->modelCategorized = d->proxyModel->isCategorizedModel(); QObject::connect(d->proxyModel,