Make preview loading faster when scrolling

Review Request #112580 - Created Sept. 7, 2013 and submitted

Frank Reininghaus
KFileItemListView notifies KFileItemModelRolesUpdater of changes of the visible index range and the icon size with a delay, to prevent that expensive operations are triggered repeatedly.

As far as I can tell, the original idea was to have a delay of 300 ms only if something really expensive (like the re-generation of all previews) would be triggered. However, as Christoph found out, this rather long delay is also used while scrolling, see

The code was a bit confusing - it used two different timers for "visible index range" changes and "icon size" changes, but both timers were assigned the same interval, which was also updated every time anything interesting happened.

I think that it gets much simpler (and preview generation more responsive) if both timers have different intervals, and the "long" interval is really only used if the icon size has changed.

Thanks to Christoph for analyzing this problem!
Previews are loaded much faster when scrolling through the view. I could not see any regressions yet.
Christoph Feck
Commit Hook
This review has been submitted with commit bf2a0d6957d0d60fe449b5445ebfd69d27c1b4e7 by Frank Reininghaus to branch KDE/4.11.
Frank Reininghaus
Review request changed

Status: Closed (submitted)