chris at gnome-de.org
Wed Oct 13 18:32:48 EEST 2004
Hi! I'm currently implementing a glib/gobject-based parser for
menu-spec-compliant menus. Up to now I've successfully generated
menu/menu-item data structs that can be easily turned into application
GtkMenus (I've coded such a widget as well), including include/exclude
rules and most of it works.
Now I'm actually a bit puzzled by the menu-spec - my application menu
contains <DefaultDirectoryDirs/>, but the subdirectories don't - should
the children use the parent's directory dirs as well?
My current implementation tries to combine each of getenv(XDG_DATA_DIRS)
with "desktop-directories" and menu->description (backwards, as stated
in the spec).
If it encounters a file named like that
(i.e. /usr/share/desktop-directories/Applications.directory), it will
generate a desktop item from that file. This desktop item will then be
used by the menu containing the <DefaultDirectoryDirs/> tag.
Therefore only my "Applications" top-level menu will scan the default
"The <DefaultDirectoryDirs> element in a menu file indicates that this
default list of directory entry locations should be scanned at that
point." The phrase "at that point" made me believe that after having
scanned it, the directory information is memory-wise discarded and only
the matching desktop item remains, so the directory information is not
available to the children nodes/menus. Am I wrong? Should all menus
include <DefaultDirectoryDirs/> if no <DirectoryDir/> is encountered?
More information about the xdg