Comment 8 for bug 297195

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

The following is true for Intrepid release (and earlier), Kubuntu (KDE4), default install

TEST CASE:
A) Not working
  1. install Kubuntu Intrepid (full release) - default install
  2. install wine (or other 3rd party package with adds menu entries to /etc/xdg/menus/applications-merged/)
  3. notice that the menu entries all show up in Lost & Found (even if manually running kbuildsycoca4 or after a reboot)
B) Working
  1. apply updated kde4libs (using attached patch)
  2. install wine (or other 3rd party package with adds menu entries to /etc/xdg/menus/applications-merged/)
  3. notice that the menu entries all show up in correct location (in this case a new menu folder Wine)
  4. notice that your other existing menu entries have not changed from default install

ANALYSIS

Under the XDG menu spec, the tag DefaultMergeDir is supposed to recurse the applications-merged directory looking for 3rd party menu items. However, since KDE4 and Gnome can both be installed, and Gnome uses the default applications.menu, without a prefix, KDE4 (kde4libs) was patched to hard code the kde4- prefix. This works for getting around the general menu collision, however, kbuildsycoca4 inherits this prefix and tries to look for kde4-applications-merged now, rather than applications-merged.

WORKAROUND(s):

The following are non-intrusive work-arounds that shows how to get it working.
  1. adding a symlink from kde4-applications-merged to applications-merged
  2. adding the MergeDir tag to kde4-applications.menu with the applications-merged directory
  3. patching kde4libs correctly (see attached)

The attached diff replaces debian patch 11_kde4_applications_menu.diff, which hard codes the the file kde4-applications.menu (from applications.menu), and causes the breakage. The reason this breaks is that the DefaultMergeDir is derived from kde4-applications.menu (becoming kde4-applications-merged) which does not exist. The updated patch instead, sets the kde4- prefix dynamically, if not set via the XDG_MENU_PREFIX env. Now DefaultMergeDir will derive from applications.menu, but we can still use the KDE4 specific kde4-applications.menu file.