Merge branch 'fix_search_callbacks' of https://github.com/jupart/qutebrowser
This commit is contained in:
commit
9ec4e749f1
@ -126,13 +126,19 @@ class WebEngineSearch(browsertab.AbstractSearch):
|
|||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._flags = QWebEnginePage.FindFlags(0)
|
self._flags = QWebEnginePage.FindFlags(0)
|
||||||
|
self.num_of_searches = 0
|
||||||
|
|
||||||
def _find(self, text, flags, callback, caller):
|
def _find(self, text, flags, callback, caller):
|
||||||
"""Call findText on the widget."""
|
"""Call findText on the widget."""
|
||||||
self.search_displayed = True
|
self.search_displayed = True
|
||||||
|
self.num_of_searches += 1
|
||||||
|
|
||||||
def wrapped_callback(found):
|
def wrapped_callback(found):
|
||||||
"""Wrap the callback to do debug logging."""
|
"""Wrap the callback to do debug logging."""
|
||||||
|
self.num_of_searches -= 1
|
||||||
|
if self.num_of_searches > 0:
|
||||||
|
return
|
||||||
|
|
||||||
found_text = 'found' if found else "didn't find"
|
found_text = 'found' if found else "didn't find"
|
||||||
if flags:
|
if flags:
|
||||||
flag_text = 'with flags {}'.format(debug.qflags_key(
|
flag_text = 'with flags {}'.format(debug.qflags_key(
|
||||||
|
Loading…
Reference in New Issue
Block a user