Clean up history module.

Eliminate out-of-date docstring and remove an unused signal.
This commit is contained in:
Ryan Roden-Corrent 2017-04-08 07:13:16 -04:00
parent 3e63b62d6e
commit 6412c88277
2 changed files with 2 additions and 23 deletions

View File

@ -72,25 +72,8 @@ class Entry:
class WebHistory(sql.SqlTable):
"""The global history of visited pages.
"""The global history of visited pages."""
This is a little more complex as you'd expect so the history can be read
from disk async while new history is already arriving.
While reading from disk is still ongoing, the history is saved in
self._temp_history instead, and then inserted into the sql table once
the async read completes.
All history which is new in this session (rather than read from disk from a
previous browsing session) is also stored in self._new_history.
self._saved_count tracks how many of those entries were already written to
disk, so we can always append to the existing data.
Signals:
cleared: Emitted after the history is cleared.
"""
cleared = pyqtSignal()
async_read_done = pyqtSignal()
def __init__(self, parent=None):
@ -128,7 +111,6 @@ class WebHistory(sql.SqlTable):
def _do_clear(self):
self.delete_all()
self.cleared.emit()
@pyqtSlot(QUrl, QUrl, str)
def add_from_tab(self, url, requested_url, title):

View File

@ -93,10 +93,7 @@ def test_clear(qtbot, tmpdir, hist, mocker):
def test_clear_force(qtbot, tmpdir, hist):
hist.add_url(QUrl('http://example.com/'))
hist.add_url(QUrl('http://www.qutebrowser.org/'))
with qtbot.waitSignal(hist.cleared):
hist.clear(force=True)
hist.clear(force=True)
assert not len(hist)