g_desktop_app_info_new fails to map prefix to subdirectory when the desktop id contains multiple dashes (-)
Submitted by Florian Boucault
Link to original bug (#654566)
Description
Documentation of g_desktop_app_info_new specifies:
"GIO also supports the prefix-to-subdirectory mapping that is described in the Menu Spec (i.e. a desktop id of kde-foo.desktop will match /usr/share/applications/kde/foo.desktop)."
g_desktop_app_info_new ("kde-foo.desktop") indeed works but:
g_desktop_app_info_new ("wine-programs-foo.desktop") does not work because it contains more than one '-'.
The menu specification [1] is clear about how it should behave:
"If the directory contains sub-directories then these sub-directories should be (recursively) scanned as well. The name of the subdirectory should be added as prefix to the desktop-file id together with a dash character ("-") So given a <AppDir>
/foo/bar and desktop entry /foo/bar/booz/Hello.desktop the desktop entry would get a desktop-file id of booz-Hello.desktop A desktop entry /foo/bar/bo/oz/Hello.desktop would result in a desktop-file id of bo-oz-Hello.desktop"
[1] http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
Version: 2.28.x