Delayed icon loading in KFileItem and dolphin

Frank Reininghaus frank78ac at googlemail.com
Wed Apr 3 16:56:34 BST 2013


Hi Emmanuel,

2013/4/2 Emmanuel Pescosta:
> Hello Frank,
> I did some experiments with KFileItemModelRolesUpdater some time ago. I
> removed all the timer stuff and replaced it by a threading-based solution
> (QtConcurrent). It works really fast, also with large folders and many
> enabled (nepomuk-) roles - should be much faster with a two-step resolving
> solution, which the current dolphin version already does (my implementation
> resolves all roles at once).
>
> But the code is in a really experimental stage (was just a proof of concept
> ;) ).

thanks for the information! It might be interesting to see the code!

However, I think that getting a threading-based solution for the
problem right might be a lot of work. The synchronization might be
non-trivial and cause subtle bugs, and we would have to check
carefully if all involved functions and classes are
reentrant/thread-safe. I still remember the surprising crash that we
got from parallel sorting because comparing dates turned out not to be
reentrant if the dates are close to a daylight saving time switch ;-)

Moreover, at least if no operations which are done in
KFileItemModelRolesUpdater block the GUI for too long, the main
improvement that a thread-based solution might bring would be that the
work could be shared between multiple CPU cores, right? But that would
only be beneficial if the CPU is the main bottleneck for anything in
that class - I'm not sure if that is the case?

Finally, I think that a two-step solution is quite useful because
determining at least the visible icons synchronously improves the user
experience IMHO.

But maybe I got something wrong, I don't know. And there are
definitely some things about KFileItemModelRolesUpdater that could be
improved :-)

Best regards,
Frank




More information about the kfm-devel mailing list