-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106244/
-----------------------------------------------------------

(Updated Oct. 25, 2012, 5:24 p.m.)


Review request for Plasma, Sebastian Kügler and Matthias Fuchs.


Changes
-------

Fix review comments.


Description
-------

Krunner's spellcheck plugin has been broken since 
bd291d21f096a714a171e7af3a534ba345ca5659 (about two years ago) because it 
called Sonnet::Speller::setLanguage every time the spellchecker was invoked, 
which was not thread-safe. 
This diff fixes the segfaults, and the feature, which I understand to be, 
basically, the ability to type 'spell french bonjour' and have it check the 
spelling.

The current code simply calls setLanguage on the second term in the search 
query, and then checks whether the resulting dictionary object is valid. The 
spell-checker expects languages like 'fr_FR' or 'French (France)' which the 
user was unlikely to type in correctly (at least, I never figured it out until 
I read the source). 

Instead, this patch create a new spell-check object (the creation is guarded by 
a mutex) when a new language is used (thus never needing to call setLanguage). 
Future queries use the already created speller for the new language, and 
spellers are deleted on the teardown() signal. 

We make a map between the speller codes and simple natural language language 
names in init(); this is a little bit tricky, because languages have 
sub-variants. My approach was to try and find the main language of the group: 
so 'french' gets you fr_FR.  For english I defaulted to US english. 

I have not tested this spelling an asian language as I don't speak one.

I have not implemented 'spell canadian french' or similar. If you want a 
specific sublanguage you have to type in the language code directly.


This addresses bugs 264779 and 303831.
    http://bugs.kde.org/show_bug.cgi?id=264779
    http://bugs.kde.org/show_bug.cgi?id=303831


Diffs (updated)
-----

  runners/spellchecker/spellcheck.h 492c370 
  runners/spellchecker/spellcheck.cpp 672732d 

Diff: http://git.reviewboard.kde.org/r/106244/diff/


Testing
-------

Compiled, installed, ran for a week and spell-checked a bunch of things in 
European languages.


Thanks,

Simeon Bird

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to