]> cloud.milkyroute.net Git - dolphin.git/commitdiff
KFileItemModelRolesUpdater: Avoid refreshing items when we receive their content...
authorMéven Car <meven29@gmail.com>
Fri, 19 Feb 2021 14:04:23 +0000 (15:04 +0100)
committerMéven Car <meven29@gmail.com>
Sat, 20 Feb 2021 18:37:00 +0000 (18:37 +0000)
It concerns the detail view.

It can cause multiple preview to be generated for the same file.
This is visible for directories whose icons use a random value for their inner files thumbnails.

Only the view needs to be updated for this model change.

src/kitemviews/kfileitemmodelrolesupdater.cpp

index ba9a8aeaa722f86143e955355cc022617a7992fa..a603a94dab77d750a83606fcf6e71ddf900e0055 100644 (file)
@@ -782,7 +782,11 @@ void KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived(const QStrin
                 data.insert("isExpandable", count > 0);
             }
 
                 data.insert("isExpandable", count > 0);
             }
 
+            disconnect(m_model, &KFileItemModel::itemsChanged,
+                       this,    &KFileItemModelRolesUpdater::slotItemsChanged);
             m_model->setData(index, data);
             m_model->setData(index, data);
+            connect(m_model, &KFileItemModel::itemsChanged,
+                       this,    &KFileItemModelRolesUpdater::slotItemsChanged);
         }
     }
 }
         }
     }
 }