1 restore XDG_MENU_PREFIX functionality
3 23:19:05 glen> hmm, xdg menus does not seem to work
4 23:19:07 glen> i mean $XDG_MENU_PREFIX
5 23:19:09 glen> is not respected
6 23:19:51 glen> 23:19:38 root[load: 3.16]@blodnatt xdg/menus# ls -l /etc/xdg/menus/${XDG_MENU_PREFIX}applications.menu
7 23:19:51 glen> -rw-r--r-- 1 root root 23K 18. mai 2012 /etc/xdg/menus/applnk-applications.menu
9 seems perberos just renamed the file not to conflict file installed by GNOME
11 additionally load mate-applications.menu if XDG_MENU_PREFIX is not set, as this
12 is how we package mate applications.menu.
13 --- mate-menus-1.5.0/./libmenu/matemenu-tree.c~ 2012-10-11 11:26:03.000000000 +0300
14 +++ mate-menus-1.5.0/./libmenu/matemenu-tree.c 2013-01-15 23:41:33.733159313 +0200
17 matemenu_tree_remove_menu_file_monitors (tree);
19 - if (strcmp(tree->basename, "mate-applications.menu") == 0 && g_getenv("XDG_MENU_PREFIX"))
20 + if (strcmp(tree->basename, "applications.menu") == 0 && g_getenv("XDG_MENU_PREFIX"))
22 char* prefixed_basename;
23 prefixed_basename = g_strdup_printf("%s%s", g_getenv("XDG_MENU_PREFIX"), tree->basename);
26 menu_file = g_strconcat(menu_name, ".menu", NULL);
28 - if (strcmp(menu_file, "mate-applications.menu") == 0 && g_getenv("XDG_MENU_PREFIX"))
29 + if (strcmp(menu_file, "applications.menu") == 0 && g_getenv("XDG_MENU_PREFIX"))
31 char* prefixed_basename;
32 prefixed_basename = g_strdup_printf("%s%s", g_getenv("XDG_MENU_PREFIX"), menu_file);
33 --- mate-menus-1.5.0/util/test-menu-spec.c~ 2012-10-11 11:26:03.000000000 +0300
34 +++ mate-menus-1.5.0/util/test-menu-spec.c 2013-01-15 23:36:26.719020435 +0200
36 flags |= MATEMENU_TREE_FLAGS_INCLUDE_NODISPLAY;
39 - // Usamos applications.menu is existe. Para compatibilidad con GNOME
40 - MateMenuTree* tree = matemenu_tree_lookup(menu_file ? menu_file : "mate-applications.menu", flags);
41 + MateMenuTree* tree = matemenu_tree_lookup(menu_file ? menu_file : "applications.menu", flags);
43 g_assert(tree != NULL);
45 --- mate-menus-1.5.0/util/mate-menus-ls.py~ 2012-10-11 11:26:03.000000000 +0300
46 +++ mate-menus-1.5.0/util/mate-menus-ls.py 2013-01-15 23:37:38.595663893 +0200
49 menu_file = options.file
51 - menu_file = 'mate-applications.menu'
52 + menu_file = 'applications.menu'
54 flags = matemenu.FLAGS_NONE
56 --- mate-menus-1.5.0/libmenu/matemenu-tree.c~ 2013-01-16 11:12:55.000000000 +0200
57 +++ mate-menus-1.5.0/libmenu/matemenu-tree.c 2013-01-16 12:36:08.224428926 +0200
58 @@ -1903,6 +1903,15 @@
59 g_free(prefixed_basename);
62 + // load mate-applications.menu
63 + if (!found && !g_getenv("XDG_MENU_PREFIX"))
65 + char* prefixed_basename;
66 + prefixed_basename = g_strdup_printf("mate-%s", menu_file);
67 + found = load_parent_merge_file_from_basename(tree, loaded_menu_files, layout, prefixed_basename, canonical_basedir);
68 + g_free(prefixed_basename);
73 found = load_parent_merge_file_from_basename(tree, loaded_menu_files, layout, menu_file, canonical_basedir);