[Panel-devel] Plasmoid categories

Alex Merry huntedhacker at tiscali.co.uk
Thu Jul 12 01:32:45 CEST 2007


Here's what I've got.  I didn't use a registry, because there is no 
obvious time to add an applet's category to the registry (we want the 
category before we load the applet).  So it just works out the list of 
categories on the fly.  It shouldn't be called too regularly, I'd have 
thought - the same or lower frequency as knownApplets() - so it 
shouldn't impact too much.

There's nothing to catch plasmoid writers who misspell a category (or 
make one up out of thin air), apart from how it will display in the 
presumed eventual plasmoid list.

Users of libplasma shouldn't have to worry about the property name for 
the category, so there are a couple of convenience functions to get the 
category of a (possibly unloaded) applet from either the applet name or 
the KPluginInfo for the applet.

As a quick demo, the control box displays the category of an applet in 
brackets next to the name, and outputs a list of known categories using 
kDebug().

Wonder if KCategorizedView would be suitable?

Alex


-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plasma-categories.diff
Type: text/x-diff
Size: 5837 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070712/f39705da/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070712/f39705da/attachment.pgp 


More information about the Panel-devel mailing list