diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-12-04 17:31:40 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-12-04 18:41:00 +0100 |
commit | 77186e49d615635b3e2e1e32aea6e5b46dcc196c (patch) | |
tree | 6f7eb445bed9e391d3e04258de760f2ac7c43876 | |
parent | 5782123f6edb7ac0dc67c9cea2f9485785de3a23 (diff) | |
download | qutebrowser-77186e49d615635b3e2e1e32aea6e5b46dcc196c.tar.gz qutebrowser-77186e49d615635b3e2e1e32aea6e5b46dcc196c.zip |
webenginesettings: Don't special-case set_dictionary_language
-rw-r--r-- | qutebrowser/browser/webengine/webenginesettings.py | 6 | ||||
-rw-r--r-- | tests/unit/browser/webengine/test_webenginesettings.py | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py index 5779b962c..0c401e2e6 100644 --- a/qutebrowser/browser/webengine/webenginesettings.py +++ b/qutebrowser/browser/webengine/webenginesettings.py @@ -285,13 +285,13 @@ class ProfileSetter: value = QWebEngineProfile.NoPersistentCookies self._profile.setPersistentCookiesPolicy(value) - def set_dictionary_language(self, warn=True): + def set_dictionary_language(self): """Load the given dictionaries.""" filenames = [] for code in config.val.spellcheck.languages or []: local_filename = spell.local_filename(code) if not local_filename: - if warn: + if not self._profile.isOffTheRecord(): message.warning("Language {} is not installed - see " "scripts/dictcli.py in qutebrowser's " "sources".format(code)) @@ -328,7 +328,7 @@ def _update_settings(option): elif option == 'spellcheck.languages': default_profile.setter.set_dictionary_language() if private_profile: - private_profile.setter.set_dictionary_language(warn=False) + private_profile.setter.set_dictionary_language() def _init_user_agent_str(ua): diff --git a/tests/unit/browser/webengine/test_webenginesettings.py b/tests/unit/browser/webengine/test_webenginesettings.py index 98a7df17c..2e667c199 100644 --- a/tests/unit/browser/webengine/test_webenginesettings.py +++ b/tests/unit/browser/webengine/test_webenginesettings.py @@ -43,6 +43,7 @@ def default_profile(monkeypatch): """ profile = QtWebEngineWidgets.QWebEngineProfile() profile.setter = webenginesettings.ProfileSetter(profile) + monkeypatch.setattr(profile, 'isOffTheRecord', lambda: False) monkeypatch.setattr(webenginesettings, 'default_profile', profile) return profile |