Get rid of tab.run_webaction

As mentioned here:
e4b0b7fffd (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.
This commit is contained in:
Florian Bruhin 2016-07-08 10:42:54 +02:00
parent 55784f9783
commit b1fda1b0ef
4 changed files with 5 additions and 11 deletions

View File

@ -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)

View File

@ -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

View File

@ -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:

View File

@ -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)