X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e92bbbe27ca39a1329ae3f2d6ecae128dd71855b..4062c4cf2d9c3a6716ced8686fa2e2324261c0ec:/src/klistview.cpp diff --git a/src/klistview.cpp b/src/klistview.cpp index 1cba47b1b..0c65b9141 100644 --- a/src/klistview.cpp +++ b/src/klistview.cpp @@ -21,7 +21,8 @@ #include "klistview.h" #include "klistview_p.h" -#include // trunc +#include // trunc on C99 compliant systems +#include // trunc for not C99 compliant systems #include #include @@ -385,6 +386,9 @@ void KListView::Private::updateScrollbars() { int lastItemBottom = cachedRectIndex(lastIndex).bottom() + listView->spacing() - listView->viewport()->height(); + + listView->verticalScrollBar()->setSingleStep(listView->viewport()->height() / 10); + listView->verticalScrollBar()->setPageStep(listView->viewport()->height()); listView->verticalScrollBar()->setRange(0, lastItemBottom); } @@ -482,6 +486,10 @@ void KListView::setItemCategorizer(KItemCategorizer *itemCategorizer) { rowsInserted(QModelIndex(), 0, d->proxyModel->rowCount() - 1); } + else + { + updateGeometries(); + } } QModelIndex KListView::indexAt(const QPoint &point) const @@ -810,6 +818,13 @@ void KListView::leaveEvent(QEvent *event) viewport()->update(); } +void KListView::startDrag(Qt::DropActions supportedActions) +{ + d->mouseButtonPressed = false; + + QListView::startDrag(supportedActions); +} + void KListView::rowsInserted(const QModelIndex &parent, int start, int end) @@ -955,11 +970,11 @@ void KListView::updateGeometries() void KListView::slotSortingRoleChanged() { - if (d->proxyModel) + if ((viewMode() == KListView::IconMode) && d->proxyModel && + d->itemCategorizer) { // Force the view to update all elements - rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - - 1); + rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - 1); } }