diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-01-05 18:56:22 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-01-05 18:56:22 +0100 |
commit | 91bdc748ad3e6859a5311977c877bb37c35337c8 (patch) | |
tree | 088ac1ac7aefd0a3f905ce4de0030d7c3c7f63b2 | |
parent | e0001cb7d071c4efe0508a50a282bda6549dee05 (diff) | |
download | qutebrowser-91bdc748ad3e6859a5311977c877bb37c35337c8.tar.gz qutebrowser-91bdc748ad3e6859a5311977c877bb37c35337c8.zip |
history: Skip cleanup steps if tables are empty
-rw-r--r-- | qutebrowser/browser/history.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py index 362d0c3e9..83c4ef2f7 100644 --- a/qutebrowser/browser/history.py +++ b/qutebrowser/browser/history.py @@ -178,7 +178,10 @@ class WebHistory(sql.SqlTable): # - but version changes happen very infrequently, rebuilding everything # gives us less corner-cases to deal with, and we can run a VACUUM to make # things smaller. - self._cleanup_history() + # + # If no history exists, we skip cleaning it up. + if self: + self._cleanup_history() rebuild_completion = True # Get a string of all patterns @@ -189,7 +192,9 @@ class WebHistory(sql.SqlTable): self.metainfo['excluded_patterns'] = patterns rebuild_completion = True - if rebuild_completion: + if rebuild_completion and self.completion: + # If no completion history exists, we don't need to spawn a dialog for + # cleaning it up. self._rebuild_completion() self.create_index('HistoryIndex', 'url') |