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