Prevent repeated re-layouting of all items after the folder has been loaded

Review Request #108984 - Created Feb. 16, 2013 and submitted

Frank Reininghaus
I tried to find reasons why scrolling is slow when opening folders with many files, see, e.g.,

I found some code in KStandardItemListView::itemSizeHintUpdateRequired() that tries to prevent expensive re-layouting when icon names or previews are received. Unfortunately, it doesn't work as intended because it only ignores changes in the "iconName" and "iconPixmap" roles, but not in the "iconOverlays" role which also changes when icon names/previews change.

After reading KStandardItemListWidgetInformant::itemSizeHint(), I had the impression that the only roles that might change the size that an item requires are the 'visibleRoles()', i.e., the roles for which text is shown next to the icon. Changing KStandardItemListView::itemSizeHintUpdateRequired() accordingly significantly reduces the number of re-layoutings for me and does not cause any visible regressions so far. I think that this is safe enough for the 4.10 branch, but I'd appreciate it if this could be confirmed by others - we really don't want regressions in the stable branch ;-)
The number of KItemListViewLayouter::doLayout() calls drops significantly according to callgrind. Haven't seen any regressions so far.
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)