From 8bdf2ee117bf006cb5e614b7c404c1ee5d772030 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Thu, 19 Nov 2009 09:05:28 +0000 Subject: [PATCH] Commented some old xdg code --- debian/changelog | 7 ++ .../mintMenu/plugins/applications.py | 92 +++++++++---------- 2 files changed, 53 insertions(+), 46 deletions(-) diff --git a/debian/changelog b/debian/changelog index 819ac1c..46ac3e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mintmenu (4.8.7) helena; urgency=low + + * Replaced xdg with gmenu (Fixes broken Games category) + * Removed calls to mouse grabs (Could fix weird bug about not being able to grab the mouse) + + -- Clement Lefebvre Thu, 19 Nov 2009 08:52:00 +0000 + mintmenu (4.8.6) helena; urgency=low * Fixed missing i18n diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index a90b468..361d901 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -20,58 +20,58 @@ from easyfiles import * from filemonitor import monitor as filemonitor -import xdg.Menu +#import xdg.Menu import gmenu # i18n gettext.install("mintmenu", "/usr/share/linuxmint/locale") # Evil patching -def xdgParsePatched(filename=None): - # conver to absolute path - if filename and not os.path.isabs(filename): - filename = xdg.Menu.__getFileName(filename) - - # use default if no filename given - if not filename: - filename = xdg.Menu.__getFileName("applications.menu") - - if not filename: - raise xdg.Menu.ParsingError(_("File not found"), "/etc/xdg/menus/applications.menu") - - # check if it is a .menu file - if not os.path.splitext(filename)[1] == ".menu": - raise xdg.Menu.ParsingError(_("Not a .menu file"), filename) - - # create xml parser - try: - doc = xdg.Menu.xml.dom.minidom.parse(filename) - except xdg.Menu.xml.parsers.expat.ExpatError: - raise xdg.Menu.ParsingError(_("Not a valid .menu file"), filename) - - # parse menufile - xdg.Menu.tmp["Root"] = "" - xdg.Menu.tmp["mergeFiles"] = [] - xdg.Menu.tmp["DirectoryDirs"] = [] - xdg.Menu.tmp["cache"] = xdg.Menu.MenuEntryCache() - - xdg.Menu.__parse(doc, filename, xdg.Menu.tmp["Root"]) - xdg.Menu.__parsemove(xdg.Menu.tmp["Root"]) - xdg.Menu.__postparse(xdg.Menu.tmp["Root"]) - - xdg.Menu.tmp["Root"].Doc = doc - xdg.Menu.tmp["Root"].Filename = filename - - # generate the menu - xdg.Menu.__genmenuNotOnlyAllocated(xdg.Menu.tmp["Root"]) - xdg.Menu.__genmenuOnlyAllocated(xdg.Menu.tmp["Root"]) - - # and finally sort - xdg.Menu.sort(xdg.Menu.tmp["Root"]) - xdg.Menu.tmp["Root"].Files = xdg.Menu.tmp["mergeFiles"] + [ xdg.Menu.tmp["Root"].Filename ] - return xdg.Menu.tmp["Root"] - -xdg.Menu.parse = xdgParsePatched +#def xdgParsePatched(filename=None): +# # conver to absolute path +# if filename and not os.path.isabs(filename): +# filename = xdg.Menu.__getFileName(filename) +# +# # use default if no filename given +# if not filename: +# filename = xdg.Menu.__getFileName("applications.menu") +# +# if not filename: +# raise xdg.Menu.ParsingError(_("File not found"), "/etc/xdg/menus/applications.menu") +# +# # check if it is a .menu file +# if not os.path.splitext(filename)[1] == ".menu": +# raise xdg.Menu.ParsingError(_("Not a .menu file"), filename) +# +# # create xml parser +# try: +# doc = xdg.Menu.xml.dom.minidom.parse(filename) +# except xdg.Menu.xml.parsers.expat.ExpatError: +# raise xdg.Menu.ParsingError(_("Not a valid .menu file"), filename) +# +# # parse menufile +# xdg.Menu.tmp["Root"] = "" +# xdg.Menu.tmp["mergeFiles"] = [] +# xdg.Menu.tmp["DirectoryDirs"] = [] +# xdg.Menu.tmp["cache"] = xdg.Menu.MenuEntryCache() +# +# xdg.Menu.__parse(doc, filename, xdg.Menu.tmp["Root"]) +# xdg.Menu.__parsemove(xdg.Menu.tmp["Root"]) +# xdg.Menu.__postparse(xdg.Menu.tmp["Root"]) +# +# xdg.Menu.tmp["Root"].Doc = doc +# xdg.Menu.tmp["Root"].Filename = filename +# +# # generate the menu +# xdg.Menu.__genmenuNotOnlyAllocated(xdg.Menu.tmp["Root"]) +# xdg.Menu.__genmenuOnlyAllocated(xdg.Menu.tmp["Root"]) +# +# # and finally sort +# xdg.Menu.sort(xdg.Menu.tmp["Root"]) +# xdg.Menu.tmp["Root"].Files = xdg.Menu.tmp["mergeFiles"] + [ xdg.Menu.tmp["Root"].Filename ] +# return xdg.Menu.tmp["Root"] +# +#xdg.Menu.parse = xdgParsePatched class Menu: def __init__( self, MenuToLookup ):