WebEngine: Don't save title if generated from URL
This commit is contained in:
parent
4b7a3db0eb
commit
dfed2f9c9c
@ -638,9 +638,7 @@ class AbstractTab(QWidget):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def _on_history_trigger(self):
|
def _on_history_trigger(self):
|
||||||
"""Emit add_history_item when triggered by backend-specific signal."""
|
"""Emit add_history_item when triggered by backend-specific signal."""
|
||||||
url = self.url()
|
raise NotImplementedError
|
||||||
requested_url = self.url(requested=True)
|
|
||||||
self.add_history_item.emit(url, requested_url, self.title())
|
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def _on_load_progress(self, perc):
|
def _on_load_progress(self, perc):
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QPoint
|
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QPoint, QUrl
|
||||||
from PyQt5.QtGui import QKeyEvent, QIcon
|
from PyQt5.QtGui import QKeyEvent, QIcon
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
# pylint: disable=no-name-in-module,import-error,useless-suppression
|
# pylint: disable=no-name-in-module,import-error,useless-suppression
|
||||||
@ -487,6 +487,20 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
def clear_ssl_errors(self):
|
def clear_ssl_errors(self):
|
||||||
log.stub()
|
log.stub()
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def _on_history_trigger(self):
|
||||||
|
url = self.url()
|
||||||
|
requested_url = self.url(requested=True)
|
||||||
|
|
||||||
|
# Don't save the title if it's generated from the URL
|
||||||
|
title = self.title()
|
||||||
|
title_url = QUrl(url)
|
||||||
|
title_url.setScheme('')
|
||||||
|
if title == title_url.toDisplayString(QUrl.RemoveScheme).strip('/'):
|
||||||
|
title = ""
|
||||||
|
|
||||||
|
self.add_history_item.emit(url, requested_url, title)
|
||||||
|
|
||||||
def _connect_signals(self):
|
def _connect_signals(self):
|
||||||
view = self._widget
|
view = self._widget
|
||||||
page = view.page()
|
page = view.page()
|
||||||
|
@ -640,6 +640,12 @@ class WebKitTab(browsertab.AbstractTab):
|
|||||||
nam = self._widget.page().networkAccessManager()
|
nam = self._widget.page().networkAccessManager()
|
||||||
nam.clear_all_ssl_errors()
|
nam.clear_all_ssl_errors()
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def _on_history_trigger(self):
|
||||||
|
url = self.url()
|
||||||
|
requested_url = self.url(requested=True)
|
||||||
|
self.add_history_item.emit(url, requested_url, self.title())
|
||||||
|
|
||||||
def set_html(self, html, base_url):
|
def set_html(self, html, base_url):
|
||||||
self._widget.setHtml(html, base_url)
|
self._widget.setHtml(html, base_url)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user