]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistselectionmanager.cpp
Show the real audio file duration in additional informations
[dolphin.git] / src / kitemviews / kitemlistselectionmanager.cpp
index 79c3370b47016980d0d950c8184eacbe3055458f..383914df01e9964d60bf009db7af636bd52fd55e 100644 (file)
@@ -291,12 +291,15 @@ void KItemListSelectionManager::itemsRemoved(const KItemRangeList& itemRanges)
         // Calling setCurrentItem() would trigger the selectionChanged signal, but we want to
         // emit it only once in this function -> change the current item manually and emit currentChanged
         m_currentItem = indexAfterRangesRemoving(m_currentItem, itemRanges);
-        if (m_currentItem < 0) {
-            m_currentItem = qMin(previousCurrent, m_model->count() - 1);
-        }
         if (m_currentItem != previousCurrent) {
             emit currentChanged(m_currentItem, previousCurrent);
         }
+
+        if (m_currentItem < 0) {
+            // The current item has been removed.
+            m_currentItem = qMin(previousCurrent, m_model->count() - 1);
+            emit currentChanged(m_currentItem, -1);
+        }
     }
 
     // Update the anchor item