mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 21:12:20 +02:00
Fix a regression that caused clicking the clear button in the main search bar to not unapply the current search until enter is pressed.
Fixes #1729819 [removing search from tool bar does not bring you back to authors and current books or main screen](https://bugs.launchpad.net/calibre/+bug/1729819)
This commit is contained in:
parent
32566d7c79
commit
24ab86f277
1 changed files with 6 additions and 1 deletions
|
|
@ -21,6 +21,8 @@
|
|||
from calibre.gui2.dialogs.search import SearchDialog
|
||||
from calibre.utils.icu import primary_sort_key
|
||||
|
||||
QT_HIDDEN_CLEAR_ACTION = '_q_qlineeditclearaction'
|
||||
|
||||
|
||||
class AsYouType(unicode):
|
||||
|
||||
|
|
@ -110,6 +112,9 @@ def __init__(self, parent=None, add_clear_action=True):
|
|||
self.setLineEdit(self.line_edit)
|
||||
if add_clear_action:
|
||||
self.lineEdit().setClearButtonEnabled(True)
|
||||
ac = self.findChild(QAction, QT_HIDDEN_CLEAR_ACTION)
|
||||
if ac is not None:
|
||||
ac.triggered.connect(self.clear_clicked)
|
||||
|
||||
c = self.line_edit.completer()
|
||||
c.setCompletionMode(c.PopupCompletion)
|
||||
|
|
@ -536,7 +541,7 @@ def __init__(self, *args, **kwargs):
|
|||
|
||||
def init_saved_seach_box_mixin(self):
|
||||
self.saved_search.changed.connect(self.saved_searches_changed)
|
||||
ac = self.findChild(QAction, '_q_qlineeditclearaction')
|
||||
ac = self.search.findChild(QAction, QT_HIDDEN_CLEAR_ACTION)
|
||||
if ac is not None:
|
||||
ac.triggered.connect(self.saved_search.clear)
|
||||
self.save_search_button.clicked.connect(
|
||||
|
|
|
|||
Loading…
Reference in a new issue