summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-06-09 18:14:01 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-06-09 21:14:04 +0200
commitb8fba0a13840557370935f049c229f590e764c6e (patch)
tree7b97604589bd89820ca1e905aaa2ec93be3bb161
parente9e6da6510633fd4739c267458b70dee4038060e (diff)
downloadqutebrowser-b8fba0a13840557370935f049c229f590e764c6e.tar.gz
qutebrowser-b8fba0a13840557370935f049c229f590e764c6e.zip
Add some documentation to WebHistory
-rw-r--r--qutebrowser/browser/history.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py
index b2e150e84..fbeb34e3d 100644
--- a/qutebrowser/browser/history.py
+++ b/qutebrowser/browser/history.py
@@ -123,6 +123,21 @@ class WebHistory(QObject):
"""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.
+
+ self.history_dict is the main place where the history is stored, in an
+ OrderedDict (sorted by time) of URL strings mapped to Entry objects.
+
+ While reading from disk is still ongoing, the history is saved in
+ self._temp_history instead, and then appended to self.history_dict once
+ that's fully populated.
+
+ 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.
+
Attributes:
history_dict: An OrderedDict of URLs read from the on-disk history.
_hist_dir: The directory to store the history in
@@ -136,8 +151,10 @@ class WebHistory(QObject):
Signals:
add_completion_item: Emitted before a new Entry is added.
+ Used to sync with the completion.
arg: The new Entry.
item_added: Emitted after a new Entry is added.
+ Used to tell the savemanager that the history is dirty.
arg: The new Entry.
cleared: Emitted after the history is cleared.
"""