]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Scroll the view when the current item has been changed
authorPeter Penz <peter.penz19@gmail.com>
Sun, 11 Dec 2011 18:20:39 +0000 (19:20 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 11 Dec 2011 18:23:02 +0000 (19:23 +0100)
We need now explicitly to scroll to the item when the current item has been changed, as this is not done automatically in the scope of KItemListView.

BUG: 288745
FIXED-IN: 4.8.0

src/kitemviews/kitemlistcontroller.cpp

index 90127aa17f8d79f5b61c58a0585b2852196e8b88..263841a85ce9e81c6dc5ddf8da4552d0a4020369 100644 (file)
@@ -314,8 +314,7 @@ void KItemListController::slotChangeCurrentItem(const QString& text, bool search
     int index;
     if (searchFromNextItem) {
         index = m_model->indexForKeyboardSearch(text, (currentIndex + 1) % m_model->count());
-    }
-    else {
+    } else {
         index = m_model->indexForKeyboardSearch(text, currentIndex);
     }
     if (index >= 0) {
@@ -323,6 +322,7 @@ void KItemListController::slotChangeCurrentItem(const QString& text, bool search
         m_selectionManager->clearSelection();
         m_selectionManager->setSelected(index, 1);
         m_selectionManager->beginAnchoredSelection(index);
+        m_view->scrollToItem(index);
     }
 }