Fix and clean up add_search_suggestions and add_apt_filter_results logic

This commit is contained in:
gm10 2019-01-27 18:21:17 +01:00
parent 078e4dde02
commit 48828788fd
No known key found for this signature in database
GPG Key ID: A981D4EA8CF993A9

View File

@ -741,28 +741,11 @@ class pluginclass(object):
if(not showns): if(not showns):
i.grab_focus() i.grab_focus()
showns = True showns = True
if not showns and os.path.exists("/usr/bin/mintinstall"): if not showns:
if len(text) >= 3: if len(text) >= 3:
if self.current_suggestion is not None and self.current_suggestion in text: self.add_search_suggestions(text)
# We're restricting our search... if self.useAPT:
self.add_search_suggestions(text)
#if (len(self.current_results) > 0):
#self.add_apt_filter_results_sync(self.current_results, text)
#else:
GLib.timeout_add(300, self.add_apt_filter_results, text) GLib.timeout_add(300, self.add_apt_filter_results, text)
else:
self.current_results = []
self.add_search_suggestions(text)
GLib.timeout_add(300, self.add_apt_filter_results, text)
self.current_suggestion = text
else:
self.current_suggestion = None
self.current_results = []
else:
self.current_suggestion = None
self.current_results = []
for i in self.categoriesBox.get_children(): for i in self.categoriesBox.get_children():
i.released() i.released()
i.set_relief(Gtk.ReliefStyle.NONE) i.set_relief(Gtk.ReliefStyle.NONE)