KFileItemModelRolesUpdater: Avoid refreshing items when we receive their content count

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.
This commit is contained in:
Méven Car 2021-02-19 15:04:23 +01:00
parent 0811bf4a2b
commit 5e5f236d00

View file

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