diff options
-rw-r--r-- | menu/ChangeLog | 5 | ||||
-rw-r--r-- | menu/menu-spec.xml | 56 | ||||
-rw-r--r-- | menu/menu.dtd | 2 |
3 files changed, 55 insertions, 8 deletions
diff --git a/menu/ChangeLog b/menu/ChangeLog index 04a5209..c4ff5a5 100644 --- a/menu/ChangeLog +++ b/menu/ChangeLog @@ -1,3 +1,8 @@ +2005-03-22 Waldo Bastian <bastian@kde.org> + + * menu-spec.xml, menu.dtd: Added type attribute to <MergeFile> + element to facilitate menu-editing. + 2005-02-24 Waldo Bastian <bastian@kde.org> * menu-spec.xml: Fixed links to www.freedesktop.org diff --git a/menu/menu-spec.xml b/menu/menu-spec.xml index 4a96308..b61063e 100644 --- a/menu/menu-spec.xml +++ b/menu/menu-spec.xml @@ -4,8 +4,8 @@ <article id="index"> <articleinfo> <title>Desktop Menu Specification</title> - <releaseinfo>Version 0.9</releaseinfo> - <date>8 December 2004</date> + <releaseinfo>Version 0.91</releaseinfo> + <date>15 March 2005</date> <authorgroup> <author> <firstname>Waldo</firstname> @@ -613,25 +613,65 @@ entries</ulink>: <varname>Categories</varname>, </listitem> </varlistentry> <varlistentry> - <term><MergeFile></term> + <term><MergeFile [type="path"|"parent"] ></term> <listitem> <para> Any number of <MergeFile> elements may be listed below a <Menu> element, giving the name of another menu file to - be merged into this one. <xref linkend="merge-algorithm"/> + be merged into this one. <xref linkend="merge-algorithm"/> specifies how merging is done. The root <Menu> of the merged file will be merged into the immediate parent of the <MergeFile> element. The <Name> element of the - root <Menu> of the merged file are ignored. If the - filename given as a <MergeFile> is not an absolute path, - it should be located relative to the location of the menu file - being parsed. + root <Menu> of the merged file are ignored. + </para> + <para> + If the type attribute is missing or set to "path" then the + contents of the <MergeFile> element indicates the + file to be merged. If this is not an absolute path then the + file to be merged should be located relative to the location + of the menu file that contains this <MergeFile> element. </para> <para> Duplicate <MergeFile> elements (that specify the same file) are handled as with duplicate <AppDir> elements (the last duplicate is used). </para> + <para> + If the type attribute is set to "parent" and the file that + contains this <MergeFile> element is located under one + of the paths specified by <varname>$XDG_CONFIG_DIRS</varname>, + the contents of the element should be ignored and the remaining + paths specified by <varname>$XDG_CONFIG_DIRS</varname> are + searched for a file with the same relative filename. The first + file encountered should be merged. There should be no + merging at all if no matching file is found. + </para> + <para> + Compatibility note: The filename specified inside the <MergeFile> + element should be ignored if the type attribute is set to "parent", + it should however be expected that implementations based on + previous versions of this specification will ignore the + type attribute and that such implementations will use the + filename inside the <MergeFile> element instead. + </para> + <para> + Example 1: If <varname>$XDG_CONFIG_HOME</varname> is "~/.config/" and + <varname>$XDG_CONFIG_DIRS</varname> is "/opt/gnome/:/etc/xdg/" + and the file ~/.config/menus/applications.menu contains + <MergeFile type="parent">/opt/kde3/etc/xdg/menus/applications.menu</MergeFile> + then the file /opt/gnome/menus/applications.menu + should be merged if it exists. If that file does not exists + then the file /etc/xdg/menus/applications.menu + should be merged instead. + </para> + <para> + Example 2: If <varname>$XDG_CONFIG_HOME</varname> is "~/.config/" and + <varname>$XDG_CONFIG_DIRS</varname> is "/opt/gnome/:/etc/xdg/" + and the file /opt/gnome/menus/applications.menu contains + <MergeFile type="parent">/opt/kde3/etc/xdg/menus/applications.menu</MergeFile> + then the file /etc/xdg/menus/applications.menu should be merged + if it exists. + </para> </listitem> </varlistentry> <varlistentry> diff --git a/menu/menu.dtd b/menu/menu.dtd index 5793017..1bca3ed 100644 --- a/menu/menu.dtd +++ b/menu/menu.dtd @@ -39,6 +39,8 @@ <!ELEMENT KDELegacyDirs EMPTY> <!ELEMENT MergeFile (#PCDATA)> +<!ATTLIST MergeFile type (path|parent) #IMPLIED> + <!ELEMENT DefaultMergeDirs EMPTY> <!ELEMENT MergeDir (#PCDATA)> |