Cache icon and accessibility in KFilePlacesItem
Review Request #107030 - Created Oct. 24, 2012 and submitted
Similar to what Dolphin does in the "Places" pane, the open/save dialog should cache devices' icons, emblems and whether it's accessible, rather then querying Solid::Device all the time. Querying can cause Solid to ask udisksd to enumerate all devices (because with udisksd2 you can't ask for just a single device), which can take a lot of time (especially when slow devices like NFS shares or slow USB sticks are present). Since this is a model item, the values are queried quite a lot, causing high CPU load from udiskds and the calling application blocks. Just try to quickly move mouse over Solid devices in the open/save dialog and what your CPU load). Most visible result of this caching is that the dialog is presented faster and you can smoothly resize the "Places" pane. Lukas Tinkl will try to optimize the Solid Udisks backend a bit to make it even faster, as this problem with device icons causing querying udisksd has impact on Dolphin start up time (and with this patch it has similar impact on the dialog show-up time).
Let me understand, what you are proposing. If Solid is slow returning the values, then the caching should be in Solid, not in every application that uses it. But until that is implemented in Solid, we could use this workaround in kfile. If that is right, I wonder what time frame is expected for a possible Solid fix. I am not familar with internals in Solid, but a patch there should be of similar complexity as this one, and I would rather wait for it instead of cluttering kfile with a workaround. If the Solid fix, however, is not expected before 4.10, then "Ship it!"