X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7b6ace6466cf349a4ce7a080d5e978aa0a7043e2..ed0df8dc1fc9576e36c920882e7f4b00a2811113:/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();