From: Peter Penz Date: Sat, 17 Feb 2007 07:16:59 +0000 (+0000) Subject: Assure that the horizontal and vertical slider position don't reset if an item is... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/86110e2778d6ac5eb4454f58de532cabfcd75dbf?ds=sidebyside Assure that the horizontal and vertical slider position don't reset if an item is deleted or added. svn path=/trunk/KDE/kdebase/apps/; revision=634399 --- diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index abb0e9f86..58c33b250 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -909,6 +909,11 @@ void DolphinView::updateSortOrder(Qt::SortOrder order) emit sortOrderChanged(order); } +void DolphinView::emitContentsMoved() +{ + emit contentsMoved(contentsX(), contentsY()); +} + void DolphinView::createView() { // delete current view @@ -949,6 +954,10 @@ void DolphinView::createView() connect(view->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), m_controller, SLOT(indicateSelectionChange())); + connect(view->verticalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(emitContentsMoved())); + connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(emitContentsMoved())); } void DolphinView::selectAll(QItemSelectionModel::SelectionFlags flags) diff --git a/src/dolphinview.h b/src/dolphinview.h index 7d6e1288f..4bb254f42 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -457,6 +457,12 @@ private slots: */ void updateSortOrder(Qt::SortOrder order); + /** + * Emits the signal contentsMoved with the current coordinates + * of the viewport as parameters. + */ + void emitContentsMoved(); + private: void startDirLister(const KUrl& url, bool reload = false);