]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
After disconnecting and reconnecting to the selectionChangedSignal() it must be check...
[dolphin.git] / src / views / dolphinview.cpp
index ad886acf251b9525072404c15e5fd11327fae4f1..238ce7ebcf829c88dc88418da480868d5079165f 100644 (file)
@@ -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,