move backend specific code out of AbstractTab into respective backend

classes.
This commit is contained in:
Marc Jauvin 2018-01-25 22:38:25 -05:00
parent 4a4a6549d0
commit d2287b7a2e
3 changed files with 9 additions and 6 deletions

View File

@ -724,12 +724,6 @@ class AbstractTab(QWidget):
self._progress = 0 self._progress = 0
self._has_ssl_errors = False self._has_ssl_errors = False
self.data.viewing_source = False self.data.viewing_source = False
if self.backend == usertypes.Backend.QtWebKit:
obj = self.networkaccessmanager()
else:
obj = self
if hasattr(obj, 'netrc_used'):
delattr(obj, 'netrc_used')
self._set_load_status(usertypes.LoadStatus.loading) self._set_load_status(usertypes.LoadStatus.loading)
self.load_started.emit() self.load_started.emit()

View File

@ -783,6 +783,8 @@ class WebEngineTab(browsertab.AbstractTab):
# https://bugreports.qt.io/browse/QTBUG-61506 # https://bugreports.qt.io/browse/QTBUG-61506
self.search.clear() self.search.clear()
super()._on_load_started() super()._on_load_started()
if hasattr(self, 'netrc_used'):
delattr(self, 'netrc_used')
@pyqtSlot(QWebEnginePage.RenderProcessTerminationStatus, int) @pyqtSlot(QWebEnginePage.RenderProcessTerminationStatus, int)
def _on_render_process_terminated(self, status, exitcode): def _on_render_process_terminated(self, status, exitcode):

View File

@ -704,6 +704,13 @@ class WebKitTab(browsertab.AbstractTab):
page = self._widget.page() page = self._widget.page()
return page.userAgentForUrl(self.url()) return page.userAgentForUrl(self.url())
@pyqtSlot()
def _on_load_started(self):
super()._on_load_started()
obj = self.networkaccessmanager()
if hasattr(obj, 'netrc_used'):
delattr(obj, 'netrc_used')
@pyqtSlot() @pyqtSlot()
def _on_frame_load_finished(self): def _on_frame_load_finished(self):
"""Make sure we emit an appropriate status when loading finished. """Make sure we emit an appropriate status when loading finished.