]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodelrolesupdater.cpp
fix folder size calculation on FUSE and network file systems
[dolphin.git] / src / kitemviews / kfileitemmodelrolesupdater.cpp
index 25e1a368531cd128f4c0094d18f51d69d06051da..566f228f6b1982f5097971d8ac22da199e062fa4 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) {
@@ -1058,7 +1058,7 @@ bool KFileItemModelRolesUpdater::applyResolvedRoles(int index, ResolveHint hint)
             data = rolesData(item);
         }
 
-        if (QIcon::hasThemeIcon(item.iconName())) {
+        if (!item.iconName().isEmpty()) {
             data.insert("iconName", item.iconName());
         }
 
@@ -1085,7 +1085,7 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
     const bool getIsExpandableRole = m_roles.contains("isExpandable");
 
     if ((getSizeRole || getIsExpandableRole) && item.isDir()) {
-        if (item.isLocalFile() && !item.isSlow()) {
+        if (item.isLocalFile()) {
             // Tell m_directoryContentsCounter that we want to count the items
             // inside the directory. The result will be received in slotDirectoryContentsCountReceived.
             if (m_scanDirectories) {