From beeb81194cba3ecaa84c6e0e334a702036a26c1e Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 24 Feb 2009 08:25:01 +0000 Subject: Stupid me: The inconsistent behavior between QListView::scrollTo() and QTreeView::scrollTo() has been fixed in Qt 4.5 :-) I should have tested this _before_ committing the huge patch for bug 185191... So: * Remove the workaround in DolphinIconsView::scrollTo() to bypass an issue in Qt 4.4 (-> fixed in Qt 4.5) * Revert the "use the DolphinController"-parts of commit 930754 and just use QAbstractItemView::scrollTo() instead. CCBUG: 185191 svn path=/trunk/KDE/kdebase/apps/; revision=930777 --- src/dolphiniconsview.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/dolphiniconsview.cpp') diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 4b861df44..4c7e9180f 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -40,7 +40,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) : KCategorizedView(parent), - m_enableScrollTo(false), m_controller(controller), m_selectionManager(0), m_autoScroller(0), @@ -88,8 +87,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle controller, SLOT(emitViewportEntered())); connect(controller, SIGNAL(zoomLevelChanged(int)), this, SLOT(setZoomLevel(int))); - connect(controller, SIGNAL(scrollToCurrentItem()), - this, SLOT(scrollToCurrentItem())); const DolphinView* view = controller->dolphinView(); connect(view, SIGNAL(showPreviewChanged()), @@ -138,19 +135,6 @@ DolphinIconsView::~DolphinIconsView() m_categoryDrawer = 0; } -void DolphinIconsView::scrollTo(const QModelIndex& index, ScrollHint hint) -{ - // Enable the QListView implementation of scrollTo() only if it has been - // triggered by a key press. Otherwise QAbstractItemView wants to scroll to the current - // index each time the layout has been changed. This becomes an issue when - // previews are loaded and the scrollbar is used: the scrollbar will always - // be reset to 0 on each new preview. - if (m_enableScrollTo || (state() != QAbstractItemView::NoState)) { - KCategorizedView::scrollTo(index, hint); - m_enableScrollTo = false; - } -} - void DolphinIconsView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { KCategorizedView::dataChanged(topLeft, bottomRight); @@ -263,7 +247,6 @@ void DolphinIconsView::dropEvent(QDropEvent* event) void DolphinIconsView::keyPressEvent(QKeyEvent* event) { - m_enableScrollTo = true; // see DolphinIconsView::scrollTo() KCategorizedView::keyPressEvent(event); m_controller->handleKeyPressEvent(event); } @@ -392,13 +375,6 @@ void DolphinIconsView::slotGlobalSettingsChanged(int category) } } -void DolphinIconsView::scrollToCurrentItem() -{ - m_enableScrollTo = true; - scrollTo(currentIndex()); - m_enableScrollTo = false; -} - void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount) { const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings(); -- cgit v1.3