From 99271699f305de4ad25a8c2a6dd7e7307cb61af7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 13 Dec 2008 14:08:07 +0000 Subject: Handling the key events for autoscrolling in DolphinViewAutoscroller does not work good enough (e. g. when letters are pressed, the current index might change too). Revert to Frank Reininhaus' original patch to fix this issue :-) CCMAIL: frank78ac@googlemail.com svn path=/trunk/KDE/kdebase/apps/; revision=896362 --- src/dolphinviewautoscroller.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/dolphinviewautoscroller.cpp') diff --git a/src/dolphinviewautoscroller.cpp b/src/dolphinviewautoscroller.cpp index b99bbc749..04a396b9a 100644 --- a/src/dolphinviewautoscroller.cpp +++ b/src/dolphinviewautoscroller.cpp @@ -36,7 +36,6 @@ DolphinViewAutoScroller::DolphinViewAutoScroller(QAbstractItemView* parent) : { m_itemView->setAutoScroll(false); m_itemView->viewport()->installEventFilter(this); - m_itemView->installEventFilter(this); m_timer = new QTimer(this); m_timer->setSingleShot(false); @@ -84,24 +83,8 @@ bool DolphinViewAutoScroller::eventFilter(QObject* watched, QEvent* event) default: break; } - } else if ((watched == m_itemView) && (event->type() == QEvent::KeyPress)) { - switch (static_cast(event)->key()) { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_Left: - case Qt::Key_Right: - case Qt::Key_PageUp: - case Qt::Key_PageDown: - case Qt::Key_Home: - case Qt::Key_End: - QMetaObject::invokeMethod(this, "scrollToCurrentIndex", Qt::QueuedConnection); - break; - default: - break; - } } - return QObject::eventFilter(watched, event); } @@ -131,12 +114,6 @@ void DolphinViewAutoScroller::scrollViewport() } } -void DolphinViewAutoScroller::scrollToCurrentIndex() -{ - const QModelIndex index = m_itemView->currentIndex(); - m_itemView->scrollTo(index); -} - void DolphinViewAutoScroller::triggerAutoScroll() { const bool verticalScrolling = (m_itemView->verticalScrollBar() != 0) && -- cgit v1.3