From 71454158cc72d071b99789ffcf4e18f7184c765d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 9 Oct 2010 16:32:02 +0000 Subject: [PATCH] After disconnecting and reconnecting to the selectionChangedSignal() it must be checked, whether the selection got reset in the meantime. svn path=/trunk/KDE/kdebase/apps/; revision=1184262 --- src/views/dolphinview.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index ad886acf2..238ce7ebc 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -537,6 +537,7 @@ void DolphinView::setUrl(const KUrl& url) // The selection model might change in the case of the column view. Disconnect // from the current selection model and reconnect later after the URL switch. + const bool hadSelection = hasSelection(); QAbstractItemView* view = m_viewAccessor.itemView(); disconnect(view->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); @@ -558,6 +559,9 @@ void DolphinView::setUrl(const KUrl& url) view = m_viewAccessor.itemView(); connect(view->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); + if (hadSelection || hasSelection()) { + emitSelectionChangedSignal(); + } } void DolphinView::selectAll() @@ -832,7 +836,8 @@ void DolphinView::slotSelectionChanged(const QItemSelection& selected, const QIt void DolphinView::emitSelectionChangedSignal() { - emit selectionChanged(DolphinView::selectedItems()); + m_selectionChangedTimer->stop(); + emit selectionChanged(selectedItems()); } void DolphinView::openContextMenu(const QPoint& pos, -- 2.47.3