Our gnome-session already exports XDG_MENU_PREFIX in the environment, so
no need to play with get/setenv. This will ease future updates.
This commit is contained in:
parent
29bc074c65
commit
edd01a446c
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.55 2011/09/28 09:47:47 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.56 2011/12/28 08:57:18 ajacoutot Exp $
|
||||
|
||||
SHARED_ONLY= Yes
|
||||
|
||||
@ -6,6 +6,7 @@ COMMENT= implementation of the FreeDesktop Desktop Menu Spec
|
||||
|
||||
GNOME_PROJECT= gnome-menus
|
||||
GNOME_VERSION= 3.2.0.1
|
||||
REVISION= 0
|
||||
|
||||
SHARED_LIBS += gnome-menu-3 0.0 # 0.0
|
||||
|
||||
|
@ -1,66 +0,0 @@
|
||||
$OpenBSD: patch-libmenu_gmenu-tree_c,v 1.4 2011/09/26 10:47:35 jasper Exp $
|
||||
|
||||
Set default menu to gnome-applications.menu if XDG_MENU_PREFIX is not set.
|
||||
|
||||
--- libmenu/gmenu-tree.c.orig Mon Aug 29 08:42:34 2011
|
||||
+++ libmenu/gmenu-tree.c Mon Sep 26 11:19:16 2011
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#include "menu-layout.h"
|
||||
#include "menu-monitor.h"
|
||||
@@ -411,16 +412,13 @@ gmenu_tree_canonicalize_path (GMenuTree *tree,
|
||||
{
|
||||
menu_file = tree->basename;
|
||||
|
||||
- if (strcmp (tree->basename, "applications.menu") == 0 &&
|
||||
- g_getenv ("XDG_MENU_PREFIX"))
|
||||
- {
|
||||
- char *prefixed_basename;
|
||||
- prefixed_basename = g_strdup_printf ("%s%s",
|
||||
- g_getenv ("XDG_MENU_PREFIX"),
|
||||
- tree->basename);
|
||||
- canonicalize_basename (tree, prefixed_basename);
|
||||
- g_free (prefixed_basename);
|
||||
- }
|
||||
+ setenv ("XDG_MENU_PREFIX", "gnome-", 0);
|
||||
+ char *prefixed_basename;
|
||||
+ prefixed_basename = g_strdup_printf ("%s%s",
|
||||
+ g_getenv ("XDG_MENU_PREFIX"),
|
||||
+ tree->basename);
|
||||
+ canonicalize_basename (tree, prefixed_basename);
|
||||
+ g_free (prefixed_basename);
|
||||
|
||||
if (!tree->canonical)
|
||||
canonicalize_basename (tree, tree->basename);
|
||||
@@ -1875,18 +1873,15 @@ load_parent_merge_file (GMenuTree *tree,
|
||||
found = FALSE;
|
||||
menu_file = g_strconcat (menu_name, ".menu", NULL);
|
||||
|
||||
- if (strcmp (menu_file, "applications.menu") == 0 &&
|
||||
- g_getenv ("XDG_MENU_PREFIX"))
|
||||
- {
|
||||
- char *prefixed_basename;
|
||||
- prefixed_basename = g_strdup_printf ("%s%s",
|
||||
- g_getenv ("XDG_MENU_PREFIX"),
|
||||
- menu_file);
|
||||
- found = load_parent_merge_file_from_basename (tree, loaded_menu_files,
|
||||
- layout, prefixed_basename,
|
||||
- canonical_basedir);
|
||||
- g_free (prefixed_basename);
|
||||
- }
|
||||
+ setenv ("XDG_MENU_PREFIX", "gnome-", 0);
|
||||
+ char *prefixed_basename;
|
||||
+ prefixed_basename = g_strdup_printf ("%s%s",
|
||||
+ g_getenv ("XDG_MENU_PREFIX"),
|
||||
+ menu_file);
|
||||
+ found = load_parent_merge_file_from_basename (tree, loaded_menu_files,
|
||||
+ layout, prefixed_basename,
|
||||
+ canonical_basedir);
|
||||
+ g_free (prefixed_basename);
|
||||
|
||||
if (!found)
|
||||
{
|
Loading…
Reference in New Issue
Block a user