--===============4313522068224156011== Content-Type: multipart/alternative; boundary="===============9199359848267210574==" --===============9199359848267210574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/106244/#review20981 ----------------------------------------------------------- This review has been submitted with commit 124e35885b8cd1b593b7b83a070bd0bd= b5758661 by Simeon Bird to branch KDE/4.9. - Commit Hook On Oct. 26, 2012, 11:26 p.m., Simeon Bird wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/106244/ > ----------------------------------------------------------- > = > (Updated Oct. 26, 2012, 11:26 p.m.) > = > = > Review request for Plasma, Sebastian K=C3=BCgler and Matthias Fuchs. > = > = > Description > ------- > = > Krunner's spellcheck plugin has been broken since bd291d21f096a714a171e7a= f3a534ba345ca5659 (about two years ago) because it called Sonnet::Speller::= setLanguage every time the spellchecker was invoked, which was not thread-s= afe. = > 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 th= e spelling. > = > The current code simply calls setLanguage on the second term in the searc= h 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 o= ut until I read the source). = > = > Instead, this patch create a new spell-check object (the creation is guar= ded by a mutex) when a new language is used (thus never needing to call set= Language). Future queries use the already created speller for the new langu= age, and spellers are deleted on the teardown() signal. = > = > We make a map between the speller codes and simple natural language langu= age names in init(); this is a little bit tricky, because languages have su= b-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=3D264779 > http://bugs.kde.org/show_bug.cgi?id=3D303831 > = > = > Diffs > ----- > = > 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 i= n European languages. > = > = > Thanks, > = > Simeon Bird > = > --===============9199359848267210574== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/106244/

This revie=
w has been submitted with commit 124e35885b8cd1b593b7b83a070bd0bdb5758661 b=
y Simeon Bird to branch KDE/4.9.

- Commit


On October 26th, 2012, 11:26 p.m., Simeon Bird wrote:

Review request for Plasma, Sebastian K=C3=BCgler and Matthias Fuchs.
By Simeon Bird.

Updated Oct. 26, 2012, 11:26 p.m.

Descripti= on

Krunner's spellcheck plugin has been broken since bd291d=
21f096a714a171e7af3a534ba345ca5659 (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, b=
asically, the ability to type 'spell french bonjour' and have it ch=
eck 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. Th=
e spell-checker expects languages like 'fr_FR' or 'French (Fran=
ce)' which the user was unlikely to type in correctly (at least, I neve=
r figured it out until I read the source). =


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


We make a map between the speller codes and simple natural language languag=
e 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: s=
o '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 w=
ant a specific sublanguage you have to type in the language code directly.<=
/pre>
  

Testing <= /h1>
Compiled, installed, ran for a week and spell-checked a bunc=
h of things in European languages.
Bugs: 264779, = 303831

Diffs=

  • runners/spellchecker/spellcheck.h (492c370= )
  • runners/spellchecker/spellcheck.cpp (67273= 2d)

View Diff

--===============9199359848267210574==-- --===============4313522068224156011== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============4313522068224156011==--