diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2019-07-09 09:42:39 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2019-07-15 17:04:39 +0200 |
commit | 1f699db3d71a0afcb961466bcc6b1a8ed6f72468 (patch) | |
tree | 4825360ad986123d730b38501b245db91a33c206 /src/core/pref_service_adapter.cpp | |
parent | 2227f9086f856223c90e7cca0637853d45b848f2 (diff) |
Ignore persisted spellchecking preferences
Ignore on-disk values of spellCheckEnabled and spellCheckLanguages prefs to
preserve backwards compatibility. Fixes deterministic failure in second run of
tst_spellchecking because the first run disabled spellchecking.
Put all settings-related tests in tst_spellchecking into one test and pretend to
check that settings are not persisted. Since settings are currently read and
written on independent task sequences without guaranteed ordering, the test
would succeed even if settings were persisted. Specifically, in code like this
profile = new QWebEngineProfile("MyProf"); // 1
delete profile; // 2
profile = new QWebEngineProfile("MyProf"); // 3
the write from line 2 will usually happen after the read from line 3. Once
persistence becomes a public feature we probably should add some way to
guarantee the proper ordering of reads and writes.
Change-Id: Icb2290417049848dbe68b7f991bbe2d52756f295
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/pref_service_adapter.cpp')
-rw-r--r-- | src/core/pref_service_adapter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp index 0cf53dda5..8a33a4b60 100644 --- a/src/core/pref_service_adapter.cpp +++ b/src/core/pref_service_adapter.cpp @@ -137,6 +137,11 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter) content::BrowserContext::CreateRandomMediaDeviceIDSalt()); } +#if QT_CONFIG(webengine_spellchecker) + // Ignore stored values for these options to preserve backwards compatibility. + m_prefService->ClearPref(spellcheck::prefs::kSpellCheckEnable); + m_prefService->ClearPref(spellcheck::prefs::kSpellCheckDictionaries); +#endif // QT_CONFIG(webengine_spellchecker) } void PrefServiceAdapter::commit() |