diff options
| author | Peter Penz <[email protected]> | 2009-06-29 19:32:39 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-06-29 19:32:39 +0000 |
| commit | c1a086da25e746ddf7dbe7f212d3cc61a9174035 (patch) | |
| tree | 68434866e3901365caf7b925d1e00afbd0862abd /src/dolphinviewautoscroller.cpp | |
| parent | 76d52a5ff1b3ec3f991ed71b322aa7bbcb2e4ef1 (diff) | |
Fixed issue that the scroll position is reset if the focus of the itemview changes.
BUG: 197951
svn path=/trunk/KDE/kdebase/apps/; revision=989236
Diffstat (limited to 'src/dolphinviewautoscroller.cpp')
| -rw-r--r-- | src/dolphinviewautoscroller.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dolphinviewautoscroller.cpp b/src/dolphinviewautoscroller.cpp index 75dab3214..ea9b1a2d6 100644 --- a/src/dolphinviewautoscroller.cpp +++ b/src/dolphinviewautoscroller.cpp @@ -54,6 +54,17 @@ bool DolphinViewAutoScroller::isActive() const return m_timer->isActive(); } +void DolphinViewAutoScroller::handleCurrentIndexChange(const QModelIndex& current, + const QModelIndex& previous) +{ + // When the autoscroller is inactive and a key has been pressed, it must be + // assured that the current item stays visible. The check whether the previous + // item is valid is important because of #197951. + if (current.isValid() && previous.isValid() && !isActive()) { + m_itemView->scrollTo(current); + } +} + bool DolphinViewAutoScroller::eventFilter(QObject* watched, QEvent* event) { if (watched == m_itemView->viewport()) { |
