More fixes...

This commit is contained in:
Clement Lefebvre 2013-05-03 00:12:24 +01:00
parent 795e6ec5bb
commit 0382cc3682
2 changed files with 11 additions and 8 deletions

2
test
View File

@ -3,5 +3,5 @@
sudo rm -rf /usr/lib/linuxmint/mintMenu sudo rm -rf /usr/lib/linuxmint/mintMenu
sudo cp -R usr / sudo cp -R usr /
sudo glib-compile-schemas /usr/share/glib-2.0/schemas sudo glib-compile-schemas /usr/share/glib-2.0/schemas
mintmenu
python /usr/lib/linuxmint/mintMenu/mintMenu.py

View File

@ -292,7 +292,7 @@ class ApplicationLauncher( easyButton ):
self.appName = self.strip_accents(desktopItem.getName()) self.appName = self.strip_accents(desktopItem.getName())
self.appGenericName = self.strip_accents(desktopItem.getGenericName()) self.appGenericName = self.strip_accents(desktopItem.getGenericName())
self.appComment = self.strip_accents(desktopItem.getComment()) self.appComment = self.strip_accents(desktopItem.getComment())
self.appExec = desktopItem.getExec() self.appExec = self.strip_accents(desktopItem.getExec())
self.appIconName = desktopItem.getIcon() self.appIconName = desktopItem.getIcon()
self.appCategories = desktopItem.getCategories() self.appCategories = desktopItem.getCategories()
self.appGnomeDocPath = desktopItem.get( "X-MATE-DocPath" ) or "" self.appGnomeDocPath = desktopItem.get( "X-MATE-DocPath" ) or ""
@ -338,10 +338,10 @@ class ApplicationLauncher( easyButton ):
def filterText( self, text ): def filterText( self, text ):
keywords = text.lower().split() keywords = text.lower().split()
appName = self.strip_accents(self.appName.lower()) appName = self.appName.lower()
appGenericName = self.strip_accents(self.appGenericName.lower()) appGenericName = self.appGenericName.lower()
appComment = self.strip_accents(self.appComment.lower()) appComment = self.appComment.lower()
appExec = self.strip_accents(self.appExec.lower()) appExec = self.appExec.lower()
for keyword in keywords: for keyword in keywords:
keyw = self.strip_accents(keyword) keyw = self.strip_accents(keyword)
if keyw != "" and appName.find( keyw ) == -1 and appGenericName.find( keyw ) == -1 and appComment.find( keyw ) == -1 and appExec.find( keyw ) == -1: if keyw != "" and appName.find( keyw ) == -1 and appGenericName.find( keyw ) == -1 and appComment.find( keyw ) == -1 and appExec.find( keyw ) == -1:
@ -353,8 +353,11 @@ class ApplicationLauncher( easyButton ):
def strip_accents(self, string): def strip_accents(self, string):
import unicodedata import unicodedata
return unicodedata.normalize('NFKD', unicode(string)).encode('UTF8', 'ignore') try:
value = unicodedata.normalize('NFKD', unicode(string)).encode('UTF8', 'ignore')
except:
value = string
return value
def getTooltip( self ): def getTooltip( self ):
tooltip = self.appName tooltip = self.appName