diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 9cc726c..4d99f5a 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -781,8 +781,9 @@ class pluginclass(object): def exact_application_search(self, search_text): shownList = [] first_button = True - # TODO: Strip case and accents keywords = self.strip_case_and_accents(search_text).split() + # I should probably make a function but whatever + # Add applications that match the appName for app in self.applicationList: for item in shownList: if app["button"].desktopFile == item.desktopFile: @@ -794,7 +795,18 @@ class pluginclass(object): app["button"].grab_focus() first_button = False shownList.append(app["button"]) - print("b") + # Add applications that match appGenericName, appComment or appExec + for app in self.applicationList: + for item in shownList: + if app["button"].desktopFile == item.desktopFile: + continue + for keyword in keywords: + if keyword != "" and (self.strip_case_and_accents(app["button"].appGenericName).find(keyword) != -1 or self.strip_case_and_accents(app["button"].appComment).find(keyword) != -1 or self.strip_case_and_accents(app["button"].appExec).find(keyword) != -1): + self.applicationsBox.pack_start(app["button"], False, False, 0) + if first_button is True: + app["button"].grab_focus() + first_button = False + shownList.append(app["button"]) def Filter(self, widget, category = None): self.filterTimer = None @@ -1735,4 +1747,4 @@ class pluginclass(object): # print "=======>>> " + item.get_name() + " = top level" # newApplicationsList.append({"entry": item, "category": ""}) - return newApplicationsList \ No newline at end of file + return newApplicationsList