Add websettings.shutdown()

This commit is contained in:
Florian Bruhin 2016-09-05 17:58:56 +02:00
parent 0ad8578aa8
commit af40abd3b2
4 changed files with 23 additions and 4 deletions

View File

@ -32,7 +32,6 @@ import datetime
import tokenize
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QWindow
from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, QUrl,
QObject, QEvent, pyqtSignal)
@ -688,9 +687,7 @@ class Quitter:
e, self._args, "Error while saving!",
pre_text="Error while saving {}".format(key))
# Disable storage so removing tempdir will work
QWebSettings.setIconDatabasePath('')
QWebSettings.setOfflineWebApplicationCachePath('')
QWebSettings.globalSettings().setLocalStoragePath('')
websettings.shutdown()
# Re-enable faulthandler to stdout, then remove crash log
log.destroy.debug("Deactivating crash log...")
objreg.get('crash-handler').destroy_crashlogfile()

View File

@ -80,6 +80,11 @@ def init():
objreg.get('config').changed.connect(update_settings)
def shutdown():
# FIXME:qtwebengine do we need to do something for a clean shutdown here?
pass
# Missing QtWebEngine attributes:
# - ErrorPageEnabled (should not be exposed, but set)
# - FullScreenSupportEnabled

View File

@ -112,6 +112,13 @@ def init():
objreg.get('config').changed.connect(update_settings)
def shutdown():
"""Disable storage so removing tmpdir will work."""
QWebSettings.setIconDatabasePath('')
QWebSettings.setOfflineWebApplicationCachePath('')
QWebSettings.globalSettings().setLocalStoragePath('')
MAPPINGS = {
'content': {
'allow-images':

View File

@ -267,3 +267,13 @@ def init():
else:
from qutebrowser.browser.webkit import webkitsettings
webkitsettings.init()
def shutdown():
"""Shut down QWeb(Engine)Settings."""
if objreg.get('args').backend == 'webengine':
from qutebrowser.browser.webengine import webenginesettings
webenginesettings.shutdown()
else:
from qutebrowser.browser.webkit import webkitsettings
webkitsettings.shutdown()