From c9f7d6771a1086df1f67c0665e27c5c47c8208e9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 4 May 2014 01:11:19 +0200 Subject: [PATCH] Enable persistent webkit storage --- qutebrowser/app.py | 2 +- qutebrowser/config/websettings.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index c22852963..c231084ff 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -125,7 +125,7 @@ class QuteBrowser(QApplication): # We didn't really initialize much so far, so we just quit hard. sys.exit(1) self.config = config.instance - websettings.init() + websettings.init(self._dirs.user_cache_dir) self.commandmanager = CommandManager() self.searchmanager = SearchManager() diff --git a/qutebrowser/config/websettings.py b/qutebrowser/config/websettings.py index ce2ea4895..c94b98a1b 100644 --- a/qutebrowser/config/websettings.py +++ b/qutebrowser/config/websettings.py @@ -101,9 +101,14 @@ STATIC_SETTERS = { settings = None -def init(): - """Initialize the global QWebSettings.""" +def init(cachedir): + """Initialize the global QWebSettings. + + Args: + cachedir: Directory to save cache files in. + """ global settings + QWebSettings.enablePersistentStorage(cachedir) settings = QWebSettings.globalSettings() for name, item in ATTRIBUTES.items(): settings.setAttribute(item, config.get('webkit', name))