]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistselectionmanager.cpp
Merge branch 'Applications/18.04'
[dolphin.git] / src / kitemviews / kitemlistselectionmanager.cpp
index efc256e1e6f97186451aa28fcce8ecda0a7e11a8..f5e097c0256eedebb467a828f159732f96f647fa 100644 (file)
@@ -235,6 +235,9 @@ void KItemListSelectionManager::itemsInserted(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 += inc;
+        if (m_currentItem >= m_model->count()) {
+            m_currentItem = -1;
+        }
         emit currentChanged(m_currentItem, previousCurrent);
     }