If this role isn't in the model yet, it would be `QVariant::Invalid`
which is obviously a distinct type from an empty string list.
This means `KFileItemModel::setData` treats them non-equal and
potentially does expensive operations on the model, which is
called every time a role is resolved in `KFileItemModelRolesUpdater`.
With this change, the number of pointless layout calculations is
significantly reduced.
for (KOverlayIconPlugin *it : qAsConst(m_overlayIconsPlugin)) {
overlays.append(it->getOverlays(item.url()));
}
- data.insert("iconOverlays", overlays);
+ if (!overlays.isEmpty()) {
+ data.insert("iconOverlays", overlays);
+ }
#if HAVE_BALOO
if (m_balooFileMonitor) {