diff --git a/qutebrowser/browser/signalfilter.py b/qutebrowser/browser/signalfilter.py index 91a9d6fe8..dd9f71ed7 100644 --- a/qutebrowser/browser/signalfilter.py +++ b/qutebrowser/browser/signalfilter.py @@ -23,7 +23,7 @@ from functools import partial from PyQt5.QtCore import QObject -from qutebrowser.utils.debug import dbg_signal +from qutebrowser.utils.debug import dbg_signal, signal_name from qutebrowser.widgets.webview import WebView from qutebrowser.utils.log import signals as logger @@ -37,8 +37,13 @@ class SignalFilter(QObject): Attributes: _tabs: The QTabWidget associated with this SignalFilter. + + Class attributes: + BLACKLIST: List of signal names which should not be logged. """ + BLACKLIST = ['cur_scroll_perc_changed', 'cur_progress'] + def __init__(self, tabs): super().__init__(tabs) self._tabs = tabs @@ -71,7 +76,7 @@ class SignalFilter(QObject): The target signal if the sender was the current widget. """ sender = self.sender() - log_signal = not signal.signal.startswith('2cur_progress') + log_signal = signal_name(signal) not in self.BLACKLIST if not isinstance(sender, WebView): # BUG? This should never happen, but it does regularely... logger.warning("Got signal {} by {} which is no tab!".format( diff --git a/qutebrowser/widgets/webview.py b/qutebrowser/widgets/webview.py index 7b9a7f3cf..b4a67c5f3 100644 --- a/qutebrowser/widgets/webview.py +++ b/qutebrowser/widgets/webview.py @@ -479,7 +479,6 @@ class WebView(QWebView): frame.scrollBarValue(Qt.Vertical)) if self._old_scroll_pos != new_pos: self._old_scroll_pos = new_pos - log.webview.debug("Updating scroll position") m = (frame.scrollBarMaximum(Qt.Horizontal), frame.scrollBarMaximum(Qt.Vertical)) perc = (round(100 * new_pos[0] / m[0]) if m[0] != 0 else 0,