From d99a7bd7ad1be61568641663924cc09fb8d47628 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 23 Nov 2016 07:57:35 +0100 Subject: [PATCH] Pass arguments to websettings init functions --- qutebrowser/app.py | 2 +- qutebrowser/browser/webengine/webenginesettings.py | 2 +- qutebrowser/browser/webkit/webkitsettings.py | 2 +- qutebrowser/config/websettings.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index edc19931c..de8a131ad 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -405,7 +405,7 @@ def _init_modules(args, crash_handler): sessions.init(qApp) log.init.debug("Initializing websettings...") - websettings.init() + websettings.init(args) log.init.debug("Initializing adblock...") host_blocker = adblock.HostBlocker() diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index 1568abad5..3a0a90c32 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -106,7 +106,7 @@ def update_settings(section, option): _init_stylesheet(profile) -def init(): +def init(_args): """Initialize the global QWebSettings.""" if config.get('general', 'developer-extras'): # FIXME:qtwebengine Make sure we call globalSettings *after* this... diff --git a/qutebrowser/browser/webkit/webkitsettings.py b/qutebrowser/browser/webkit/webkitsettings.py index 5fe27c48b..b6b2f7ddf 100644 --- a/qutebrowser/browser/webkit/webkitsettings.py +++ b/qutebrowser/browser/webkit/webkitsettings.py @@ -102,7 +102,7 @@ def update_settings(section, option): websettings.update_mappings(MAPPINGS, section, option) -def init(): +def init(_args): """Initialize the global QWebSettings.""" cache_path = standarddir.cache() data_path = standarddir.data() diff --git a/qutebrowser/config/websettings.py b/qutebrowser/config/websettings.py index 6f1304057..3942189eb 100644 --- a/qutebrowser/config/websettings.py +++ b/qutebrowser/config/websettings.py @@ -259,14 +259,14 @@ def update_mappings(mappings, section, option): mapping.set(value) -def init(): +def init(args): """Initialize all QWeb(Engine)Settings.""" - if objreg.get('args').backend == 'webengine': + if args.backend == 'webengine': from qutebrowser.browser.webengine import webenginesettings - webenginesettings.init() + webenginesettings.init(args) else: from qutebrowser.browser.webkit import webkitsettings - webkitsettings.init() + webkitsettings.init(args) def shutdown():