--nextPart5438379.jX9YyW8B6L Content-Type: multipart/mixed; boundary="Boundary-01=_vzMGCBfXG/ti/yM" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_vzMGCBfXG/ti/yM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 19 February 2005 11:40, Anders Lund wrote: > On Saturday 19 February 2005 11:26, Luk=C3=A1=C5=A1 Tinkl wrote: > > > I vote for "#ifdef HAVE_ASPELL_60" approach. I do not know how to > > > implement it, though. > > > > > > What do the others think? Any idea how to solve it? > > > > Yes, I wanted to suggest the ifdef approach too; anyone volunteers to > > write the configure check? :) > > So after upgrading aspell over that line, you'll need to recompile kdelib= s? > Can't aspell be queried for its version, and the string handled > accordingly? > > -anders Sure, see patch (or update to latest CVS), please test. Does it detect aspe= ll=20 v0.60 correctly? Cheers, Waldo =2D-=20 bastian@kde.org | Free Novell Linux Desktop 9 Evaluation Download bastian@suse.com | http://www.novell.com/products/desktop/eval.html --Boundary-01=_vzMGCBfXG/ti/yM Content-Type: text/x-diff; charset="utf-8"; name="kspell_aspell.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kspell_aspell.patch" Index: kspell.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/kdeui/kspell.cpp,v retrieving revision 1.130 diff -u -p -r1.130 kspell.cpp =2D-- kspell.cpp 25 Nov 2004 06:28:55 -0000 1.130 +++ kspell.cpp 20 Feb 2005 17:41:39 -0000 @@ -33,8 +33,10 @@ #include #endif =20 +#include #include #include + #include #include #include @@ -76,6 +78,7 @@ public: bool checking; QValueList unchecked; QTimer *checkNextTimer; + bool aspellV6; }; =20 //TODO @@ -122,11 +125,36 @@ void KSpell::hide() { ksdlg->hide(); } int KSpell::heightDlg() const { return ksdlg->height(); } int KSpell::widthDlg() const { return ksdlg->width(); } =20 +// Check if aspell is at least version 0.6 +static bool determineASpellV6() +{ + QString result; + FILE *fs =3D popen("aspell -v", "r"); + if (fs) + { + QTextStream ts(fs, IO_ReadOnly); + result =3D ts.read().stripWhiteSpace(); + pclose(fs); + } + +qWarning("Aspell Result: %s", result.latin1()); + QRegExp rx("Aspell (\\d.\\d)"); + if (rx.search(result) !=3D -1) + { + float version =3D rx.cap(1).toFloat(); +qWarning("Version: %f", version); + return (version >=3D 0.6); =20 + } + return false; +} + =20 void KSpell::startIspell() //trystart =3D {0,1,2} { + if ((trystart =3D=3D 0) && (ksconfig->client() =3D=3D KS_CLIENT_ASPELL)) + d->aspellV6 =3D determineASpellV6(); =20 kdDebug(750) << "Try #" << trystart << endl; =20 @@ -232,6 +260,11 @@ KSpell::startIspell() break; case KS_E_UTF8: *proc << "-Tutf8"; + if (ksconfig->client() =3D=3D KS_CLIENT_ASPELL) + *proc << "--encoding=3Dutf-8"; + else + *proc << "-Tutf8"; + break; case KS_E_KOI8U: *proc << "-w'"; // add ' as a word char @@ -1011,7 +1044,7 @@ void KSpell::check2( KProcIO * ) dlgresult=3D-1; =20 // for multibyte encoding posinline needs correction =2D if (ksconfig->encoding() =3D=3D KS_E_UTF8) { + if ((ksconfig->encoding() =3D=3D KS_E_UTF8) && !d->aspellV6) { // kdDebug(750) << "line: " << origbuffer.mid(lastlastline, // lastline-lastlastline) << endl; // kdDebug(750) << "posinline uncorr: " << posinline << endl; @@ -1408,6 +1441,7 @@ void KSpell::initialize( QWidget *_paren d->m_bNoMisspellingsEncountered =3D true; d->type =3D type; d->checking =3D false; + d->aspellV6 =3D false; d->checkNextTimer =3D new QTimer( this ); connect( d->checkNextTimer, SIGNAL( timeout() ), this, SLOT( checkNext() )); --Boundary-01=_vzMGCBfXG/ti/yM-- --nextPart5438379.jX9YyW8B6L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQBCGMzyN4pvrENfboIRAl4iAJ9J9sQad3b7QtEe8uWSDIFzGWluzwCgkOlR KlO4BURu4pnK2HMcV//6V/4= =cURt -----END PGP SIGNATURE----- --nextPart5438379.jX9YyW8B6L--