Enable persistent webkit storage

This commit is contained in:
Florian Bruhin 2014-05-04 01:11:19 +02:00
parent 851f473e0c
commit c9f7d6771a
2 changed files with 8 additions and 3 deletions

View File

@ -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()

View File

@ -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))