Clear url from visitedLinks if a single url is deleted

This commit is contained in:
Jay Kamat 2018-05-07 13:48:06 -07:00
parent d0b2360745
commit ca48f9f100
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 8 additions and 0 deletions

View File

@ -52,7 +52,10 @@ class WebHistory(sql.SqlTable):
"""The global history of visited pages."""
# All web history cleared
history_cleared = pyqtSignal()
# one url cleared
url_cleared = pyqtSignal(QUrl)
def __init__(self, parent=None):
super().__init__("History", ['url', 'title', 'atime', 'redirect'],
@ -171,6 +174,7 @@ class WebHistory(sql.SqlTable):
qtutils.ensure_valid(qurl)
self.delete('url', self._format_url(qurl))
self.completion.delete('url', self._format_completion_url(qurl))
self.url_cleared.emit(qurl)
@pyqtSlot(QUrl, QUrl, str)
def add_from_tab(self, url, requested_url, title):

View File

@ -79,6 +79,10 @@ def init():
webenginesettings.default_profile.clearAllVisitedLinks)
hist.history_cleared.connect(
webenginesettings.private_profile.clearAllVisitedLinks)
hist.url_cleared.connect(
lambda url: webenginesettings.default_profile.clearVisitedLinks([url]))
hist.url_cleared.connect(
lambda url: webenginesettings.private_profile.clearVisitedLinks([url]))
# Mapping worlds from usertypes.JsWorld to QWebEngineScript world IDs.