Overlay icons in KFileItem
David Faure
faure at kde.org
Fri Feb 4 09:53:58 GMT 2011
On Sunday 26 December 2010, Alex Fiestas wrote:
> Hi there
>
> I'd like to add an overlay bluetooth icon for those folders and files
> which are being shared trhogh bluetooth. I have been looking around and
> so far I've
> saw 2 ways of doing it:
>
> 1-Modify KFileItem and adding it (just like we do with samba share)
> 2-Implementing a Control Version plugin.
>
> Neither option seems optimal to me, with the first I will have to wait
> until 4.7 and the second is not designed (althought it seems flexible
> enough) to do
> what I intent to do.
I had a look, and I don't really have a better idea. Overlays can come from
kioslaves, but I presume you're talking about file:/, and modifying kio_file
wouldn't be much better.
If you modify KFileItem, how will you implement that, given that the
information about sharing is probably in extragear?
In fact one solution would be "modify KFileItem to use (global) plugins for
determining overlays". Sounds over-engineered, but it's already better than
calling a binary from KFileItem::overlays() :-)
This isn't mimetype based or protocol based, so we would just call all
available plugins in turn, and let them return additional overlays for the
overlay list. We would only load the plugins the very first time (intenral
singleton), so it should be fast afterwards, if all plugins can figure out
quickly what to do.
You'll still have to wait for kdelibs-4.7, but at least it will be a nice and
extensible solution for future similar needs.
PS: I don't know control version plugins, other than that they exist, so I
can't advise on these, but it does sound strange -- and it wouldn't work in
KFileDialog, right?
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
More information about the kfm-devel
mailing list