From 8392acfa8ec947aaebe66d01f9dae0d06d23e11d Mon Sep 17 00:00:00 2001 From: Icius Date: Fri, 22 Jan 2010 15:54:03 -0500 Subject: [PATCH] Added code to determine if the user truly modifed the .desktop file using gnome-desktop-item-edit. If they did not make any changes then the user's local copy is removed. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 82e3450..8c7359b 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -12,6 +12,7 @@ import gettext import gnomevfs import threading import commands +import filecmp from easybuttons import * from execute import Execute @@ -748,8 +749,14 @@ class pluginclass( object ): open(file_path, 'w').write(data) os.system('gnome-desktop-item-edit ' + file_path) - self.mintMenuWin.hide() + if filecmp.cmp(widget.desktopFile, file_path): + try: + os.remove(file_path) + except os.error: + pass + + self.mintMenuWin.hide() def onUninstallApp( self, menu, widget ): widget.uninstall()