[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Fix KSpell2 + KWord spellcheck problem
From:       Mashrab Kuvatov <kmashrab () sat ! physik ! uni-bremen ! de>
Date:       2005-04-25 14:18:17
Message-ID: 200504251618.25096.kmashrab () sat ! physik ! uni-bremen ! de
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi all,

let me start with KWord first. At the moment, spellchecking with KWord-CVS
works only once. The reason is after spellchecking is finished KWord does not
delete the broker. The attached patch fixes it, but KWord crashes on
"Finished" button in spellchecker dialog. Read on.

Now, KSpell2. Pressing "Finished" button in KSpell2 dialog it emits stop and
done signals. With the current implementation of spellchecking in KWord (plus
attached patch) and KPresenter these apps after catching stop signal delete
the broker. So, emitting done( d->checker->filter()->buffer() ) crashes the
app. The attached patch fixes this too.

Zack, David what do you think? Can we emit only stop signal?

While we are at it, IMHO "Finish" is better than "Finished". Is it just my
taste?

Cheers,
Mashrab. 

-- 
Mashrab Kuvatov
Ph.D student
University of Bremen, IUP
Home-page: www.sat.uni-bremen.de/members/mashrab
PGP key: www.uni-bremen.de/~kmashrab/kmashrab.asc

["dialog.cpp.patch" (text/x-diff)]

? dialog.cpp.patch
Index: ui/dialog.cpp
===================================================================
RCS file: /home/kde/kdelibs/kspell2/ui/dialog.cpp,v
retrieving revision 1.12.2.1
diff -u -3 -p -r1.12.2.1 dialog.cpp
--- ui/dialog.cpp	24 Apr 2005 09:20:57 -0000	1.12.2.1
+++ ui/dialog.cpp	25 Apr 2005 13:53:41 -0000
@@ -148,7 +148,10 @@ void Dialog::slotFinished()
     kdDebug()<<"void Dialog::slotFinished() \n";
     emit stop();
     //FIXME: should we emit done here?
-    emit done( d->checker->filter()->buffer() );
+    //IMHO, apps may delete broker after catching any of stop,
+    //done or cancel signals. So, if we emit two such signals
+    //one after another, app crashes.
+    //emit done( d->checker->filter()->buffer() );
     accept();
 }
 

["kwview.cc.patch" (text/x-diff)]

Index: kwview.cc
===================================================================
RCS file: /home/kde/koffice/kword/kwview.cc,v
retrieving revision 1.1090
diff -u -3 -p -r1.1090 kwview.cc
--- kwview.cc	25 Apr 2005 11:46:07 -0000	1.1090
+++ kwview.cc	25 Apr 2005 13:47:25 -0000
@@ -5555,6 +5555,8 @@ void KWView::clearSpellChecker(bool canc
 
     delete m_spell.textIterator;
     m_spell.textIterator = 0L;
+    delete m_spell.kospell;
+    m_spell.kospell = 0;
     if ( m_spell.macroCmdSpellCheck )
     {
         if ( !cancelSpellCheck )

[Attachment #7 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic