]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodelrolesupdater.cpp
Allow folder creation on desktop via F10 shortcut
[dolphin.git] / src / kitemviews / kfileitemmodelrolesupdater.cpp
index 25e1a368531cd128f4c0094d18f51d69d06051da..f27c421b4051ddb16d386d91a51dc4fb3c9197fe 100644 (file)
@@ -957,9 +957,9 @@ void KFileItemModelRolesUpdater::updateChangedItems()
     QList<int> visibleChangedIndexes;
     QList<int> invisibleChangedIndexes;
 
-    QMutableSetIterator<KFileItem> it(m_changedItems);
-    while (it.hasNext()) {
-        const KFileItem item = it.next();
+    // Iterate over a const copy because items are deleted within the loop
+    const auto changedItems = m_changedItems;
+    for (const KFileItem &item : changedItems) {
         const int index = m_model->index(item);
 
         if (index < 0) {