GNOME Bugzilla – Bug 683535
alacarte does not respect $XDG_MENU_PREFIX
Last modified: 2012-10-15 13:42:02 UTC
Alacarte does not respect $XDG_MENU_REFIX (env var), and as a consequence, when this variable is set, does not write to the right applications.menu file (at least not the same as gnome-shell is parsing). As a consequence, hiding/unhiding items is not possible
Created attachment 223709 [details] [review] Attempt to fix the issue
Where does that variable come from, and why should we look at it ? This is the first time I hear about it...
gnome-menus knows about this sicne 2008: http://git.gnome.org/browse/gnome-menus/commit/libmenu?id=eba974eb23195afbed3440f35a57b227a19ffe29
See also http://developer.gnome.org/menu-spec/
Ah, I didn't know that. What a terrible idea to use an env var for that :-( But since it is there, alacarte should probably respect it, indeed
(In reply to comment #5) > Ah, I didn't know that. What a terrible idea to use an env var for that :-( > But since it is there, alacarte should probably respect it, indeed Indeed... having the same behavior across the tools is the way to go (even if we consider it not the best approach... still better than being inconsistent between our own tools)
Review of attachment 223709 [details] [review]: ::: Alacarte/MenuEditor.py @@ +25,2 @@ class MenuEditor(object): + def __init__(self, name=os.environ['XDG_MENU_PREFIX'] + 'applications.menu'): concatenating paths with "+" is a bad idea (since you might not get the / separator). should use os.path.join.
oh nevermind, i should have read the spec about what the variable is defined to be.
I'd rather move the path calculation utilities into gnome-menus so that we can remove the duplicated code here.
*** Bug 678924 has been marked as a duplicate of this bug. ***
(In reply to comment #7) > Review of attachment 223709 [details] [review]: > > ::: Alacarte/MenuEditor.py > @@ +25,2 @@ > class MenuEditor(object): > + def __init__(self, name=os.environ['XDG_MENU_PREFIX'] + > 'applications.menu'): > > concatenating paths with "+" is a bad idea (since you might not get the / > separator). should use os.path.join. It's not supposed to be a subdir. It's supposed to be something like /etc/xdg/menus/xfce-applications.menu, so you'd set XDG_MENU_PREFIX to be 'xfce-'
Review of attachment 223709 [details] [review]: On second thought, this is a better solution. Commit, please.
JFYI: I can't commit; no access.
Created attachment 226465 [details] [review] Backport to the gnome-3-4 branch I backported the fix to the gnome-3-4 branch and I confirm that bug 678924 is fixed now. New menus and items can be created under LXDE on Fedora 17.