D9491: Sonnet: fix wrong language for suggestions in mixed-language texts

David Faure noreply at phabricator.kde.org
Sat Dec 23 19:34:39 UTC 2017


dfaure created this revision.
dfaure added reviewers: sandsmark, mlaurent.
Restricted Application added a project: Frameworks.

REVISION SUMMARY
  When AutoDetectLanguage is set, the same document can contain multiple
  languages. In that case, Highlighter stores the language information
  into the block's userdata, and changes the spellchecker language at
  every change. So the suggestions were using whatever was the language
  of the last block that was checked, which led to pretty random behaviour
  for the user.
  
  Fixed by using a QTextCursor to retrieve the cached language for the
  word we're showing suggestions for.
  
  Includes a separate commit for Loader:
  
    honour Settings::defaultClient(), useful for unittests.

TEST PLAN
  Spellchecking in kmail composer, writing text in French
  and having a signature with word in English.

REPOSITORY
  R246 Sonnet

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D9491

AFFECTED FILES
  autotests/CMakeLists.txt
  autotests/test_highlighter.cpp
  src/core/loader.cpp
  src/ui/highlighter.cpp
  src/ui/highlighter.h
  src/ui/spellcheckdecorator.cpp

To: dfaure, sandsmark, mlaurent
Cc: #kde_pim, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171223/c20217c1/attachment.html>


More information about the Kde-frameworks-devel mailing list