[RESENT] menu-spec confusion
Christian Neumair
chris at gnome-de.org
Tue Nov 2 19:42:53 EET 2004
originally sent on 2004-10-13:
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
directory dirs.
"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?
regs,
Chris
More information about the xdg
mailing list