Registered Categories as per Freedesktop Menu Specification 0.8

Danny Milosavljevic danny.milo at gmx.net
Mon Jan 12 03:17:01 CET 2004


Hi,

Attached a cache generator for menu categories, a source xml, a target
xml.

usage:
  ./catcache.py

generates xfce-registered-categories-cache.xml from
xfce-registered-categories.xml.

Mini description at the top of catcache.py.

A menu parser would:
- parse desktop files:
- for each desktop file:
- strdup dentry.categories
- order dentry.categories the same as <category > entries are ordered in
xfce-registered-categories-cache.xml (if said category present there) 
- order userdefined categories (i.e. not present in xml) last,
- for each category in ordered dentry.categories:
- paths += get paths for category from cache or generate "/Others" path

then:
- for each path in paths.removedupes():
- add item(path + "/" + dentry.name)

And this would generate a pretty menu with lots of icons and short too
:)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: categories.tar.gz
Type: application/x-compressed-tar
Size: 4457 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20040112/d825b1ed/attachment.bin>


More information about the Xfce4-dev mailing list