Spell only when pyqt>=5.8
This commit is contained in:
parent
2150154350
commit
b840b8066b
@ -323,8 +323,6 @@ MAPPINGS = {
|
||||
'scrolling.smooth':
|
||||
Attribute(QWebEngineSettings.ScrollAnimatorEnabled),
|
||||
|
||||
'spell': DefaultProfileSetter('setSpellCheckEnabled'),
|
||||
'spell_languages': DictionaryLanguageSetter()
|
||||
}
|
||||
|
||||
try:
|
||||
@ -335,6 +333,11 @@ except AttributeError:
|
||||
pass
|
||||
|
||||
|
||||
if qtutils.version_check('5.8'):
|
||||
MAPPINGS['spell'] = DefaultProfileSetter('setSpellCheckEnabled')
|
||||
MAPPINGS['spell_languages'] = DictionaryLanguageSetter()
|
||||
|
||||
|
||||
if qtutils.version_check('5.9'):
|
||||
# https://bugreports.qt.io/browse/QTBUG-58650
|
||||
MAPPINGS['content.cookies.store'] = PersistentCookiePolicy()
|
||||
|
@ -981,6 +981,9 @@ spell:
|
||||
type: Bool
|
||||
default: true
|
||||
desc: Enable spell checking.
|
||||
backend:
|
||||
QtWebKit: false
|
||||
QtWebEngine: Qt 5.8
|
||||
|
||||
spell_languages:
|
||||
type:
|
||||
@ -1033,6 +1036,9 @@ spell_languages:
|
||||
none_ok: true
|
||||
default:
|
||||
desc: Spell checking languages.
|
||||
backend:
|
||||
QtWebKit: false
|
||||
QtWebEngine: Qt 5.8
|
||||
|
||||
## statusbar
|
||||
|
||||
|
@ -130,8 +130,8 @@ def _get_dictionary_tag(tag):
|
||||
return None
|
||||
|
||||
event = match.group('event')
|
||||
dict = match.group('dict')
|
||||
has_dict = dict in [lang.code for lang in get_installed_languages()]
|
||||
dictionary = match.group('dict')
|
||||
has_dict = dictionary in [lang.code for lang in get_installed_languages()]
|
||||
if event == 'must_have_dict':
|
||||
return pytest.mark.skipif(not has_dict, reason=tag)
|
||||
elif event == 'cannot_have_dict':
|
||||
|
@ -47,7 +47,7 @@ def test_get_installed_languages_non_empty(tmpdir, mocker):
|
||||
mocker.patch('qutebrowser.browser.webengine.spell.get_dictionary_dir',
|
||||
lambda: str(tmpdir))
|
||||
for lang in LANGUAGE_LIST:
|
||||
open(join(tmpdir, lang.file), 'w', encoding='UTF-8').close()
|
||||
open(join(str(tmpdir), lang.file), 'w', encoding='UTF-8').close()
|
||||
for actual, expected in zip(spell.get_installed_languages(),
|
||||
LANGUAGE_LIST):
|
||||
assert (actual.code, actual.name, actual.file) ==\
|
||||
|
Loading…
Reference in New Issue
Block a user