Fix the problem that scrolling is extremely slow when hidden files are shown
Review Request #111956 - Created Aug. 8, 2013 and submitted
The problem was that KIconLoader::global()->drawOverlays(overlays, m_pixmap, KIconLoader::Desktop); which is quite slow, is called every time just before an item with overlays appears on the screen. We can fix that by extending the cool icon caching that Emmanuel implemented some time ago: cache not only the pixmaps for the icons, but the pixmaps for icon+overlay. This fixes the problem for the icons. For the previews, I think it's best to apply the overlays in KFileItemModelRolesUpdater. This ensures that the overlays are applied just once, and not every time the preview is shown on the screen. The "apply overlays" code is duplicated now, but I still think that this is the cleanest solution. If anyone has better ideas, please let me know!
Scrolling is much faster when hidden items and symlinks are shown. The overlays are still applied correctly for icons and previews.