From b1fda1b0efc1d190ddfdfcd3a6c644b49dcb160d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 8 Jul 2016 10:42:54 +0200 Subject: [PATCH] Get rid of tab.run_webaction As mentioned here: https://github.com/The-Compiler/qutebrowser/pull/1629/files/e4b0b7fffd069eaf05a2ae817d59ce1c3b88c466#r70002693 It makes no sense to add a backend-specific run_webaction method to AbstractTab - better to just access _widget directly in this one place instead of adding something backend-speficic to the API. --- qutebrowser/browser/commands.py | 5 ++++- qutebrowser/browser/tab.py | 3 --- qutebrowser/browser/webengine/webenginetab.py | 3 --- qutebrowser/browser/webkit/webkittab.py | 5 +---- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 033c5c3f5..33886d025 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1679,7 +1679,10 @@ class CommandDispatcher: action)) for _ in range(count): - tab.run_webaction(member) + # This whole command is backend-specific anyways, so it makes no + # sense to introduce some API for this. + # pylint: disable=protected-access + tab._widget.triggerPageAction(member) @cmdutils.register(instance='command-dispatcher', scope='window', maxsplit=0, no_cmd_split=True) diff --git a/qutebrowser/browser/tab.py b/qutebrowser/browser/tab.py index 8efe93352..868014ba0 100644 --- a/qutebrowser/browser/tab.py +++ b/qutebrowser/browser/tab.py @@ -527,9 +527,6 @@ class AbstractTab(QWidget): def icon(self): raise NotImplementedError - def run_webaction(self, action): - raise NotImplementedError - def set_html(self, html, base_url): raise NotImplementedError diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 9e68606e4..d178c2e4e 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -228,9 +228,6 @@ class WebEngineViewTab(tab.AbstractTab): def icon(self): return self._widget.icon() - def run_webaction(self, action): - self._widget.triggerPageAction(action) - def set_html(self, html, base_url): # FIXME:qtwebengine # check this and raise an exception if too big: diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 0e35d34f1..f973abb0e 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -499,7 +499,7 @@ class WebViewTab(tabmod.AbstractTab): action = QWebPage.ReloadAndBypassCache else: action = QWebPage.Reload - self.run_webaction(action) + self._widget.triggerPageAction(action) def stop(self): self._widget.stop() @@ -511,9 +511,6 @@ class WebViewTab(tabmod.AbstractTab): nam = self._widget.page().networkAccessManager() nam.clear_all_ssl_errors() - def run_webaction(self, action): - self._widget.triggerPageAction(action) - def set_html(self, html, base_url): self._widget.setHtml(html, base_url)