]> cloud.milkyroute.net Git - dolphin.git/commitdiff
After disconnecting and reconnecting to the selectionChangedSignal() it must be check...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 9 Oct 2010 16:32:02 +0000 (16:32 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 9 Oct 2010 16:32:02 +0000 (16:32 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1184262

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,