Fix #1902807 [Clearing search history clears current search from bar](https://bugs.launchpad.net/calibre/+bug/1902807)

This commit is contained in:
Kovid Goyal 2020-11-04 08:23:23 +05:30
parent d2c52b5b8e
commit 480b2c6122
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -156,9 +156,10 @@ class SearchBox2(QComboBox): # {{{
self.colorize = colorize
self.clear()
def clear_search_history(self):
def clear_history(self):
config[self.opt_name] = []
self.clear()
clear_search_history = clear_history
def hide_completer_popup(self):
try:
@ -173,9 +174,6 @@ class SearchBox2(QComboBox): # {{{
def text(self):
return self.currentText()
def clear_history(self, *args):
QComboBox.clear(self)
def clear(self, emit_search=True):
self.normalize_state()
self.setEditText('')