Moving code for "Open With" and ServiceMenu actions to kdelibs

David Faure faure at kde.org
Tue Mar 17 21:03:03 CET 2009


The code for handling "open with" action/submenus and servicemenus (RMB / Actions / ...)
is currently in libkonq (and used by dolphin and konqueror), but I have received a number
of requests for moving that code up to kdelibs.
It is already used by the plasma "Locations" runner AFAIK, which won't have to link to libkonq
anymore, and at least "Open With <default file manager>" will be used in KFileDialog,
and I'm sure there are more potential users of "open with" and servicemenus.

The attached patch adds two classes to kdelibs:
* KFileItemListProperties (which stores common properties for a list of items,
 and determines which capabilities are available, like all-readable, all-writable, etc.). Unittest included.
* KFileItemActions - the class which implements "Open with" and servicemenu actions.

The first one belongs obviously to kio (could even have been part of KFileItemList
if had a d pointer... that's for kde5); I wasn't exactly sure about the second one,
could have been for libkfile too. OTOH the goal of this move is do generalize
the use of those actions outside of file managers, so libkio is probably better.

Thanks for reviewing the patch (especially the API, which I already cleaned up
compared to what was in libkonq).

Of course I also ported the libkonq classes to those new classes (can't remove
them, for BC reasons, but they are now mere wrappers).

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfileitemactions.diff
Type: text/x-patch
Size: 44024 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090317/fe452d47/attachment-0001.diff 


More information about the Plasma-devel mailing list