diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-12 20:12:05 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-12 20:12:05 (GMT) |
commit | fed5435ca8e69f6b476f31e6ec3a748fa0b02c15 (patch) | |
tree | c6547172e004633b7283427541fc7f554ee65700 /globalhistory.py | |
parent | 2decba58009262ca6c3855575bc7508235ef269f (diff) |
Implement the sqlite store.
Diffstat (limited to 'globalhistory.py')
-rw-r--r-- | globalhistory.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/globalhistory.py b/globalhistory.py index 635deca..ae7b999 100644 --- a/globalhistory.py +++ b/globalhistory.py @@ -41,13 +41,13 @@ class GlobalHistory: return place != None def addURI(self, uri, redirect, toplevel, referrer): - place = places.Place(uri.spec) - - place.redirect = redirect - place.toplevel = toplevel - place.referrer = referrer - - self._store.add_place(place) + place = self._store.lookup_place(uri.spec) + if place: + place.visits += 1 + self._store.update_place(place) + else: + place = places.Place(uri.spec) + self._store.add_place(place) def setPageTitle(self, uri, title): place = self._store.lookup_place(uri.spec) @@ -71,10 +71,6 @@ class GlobalHistory: place.gecko_flags = flags self._store.update_place(place) -def init(): - global _global_history - _global_history = GlobalHistory() - components.registrar.registerFactory(GlobalHistory.cid, GlobalHistory.description, '@mozilla.org/browser/global-history;2', |