[Bug 166029] Replace in spell dialog closes dialog

Zack Rusin zack at kde.org
Tue Jul 8 19:05:20 CEST 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=166029         




------- Additional Comments From zack kde org  2008-07-08 19:05 -------
On Tuesday 08 July 2008 12:32:37 pm Tobias Koenig wrote:
> On Tue, Jul 08, 2008 at 03:06:53PM -0000, Tobias Koenig wrote:
> Hej,
>
> > The problem only appears if autospellchecking is enabled in KTextEdit.
> > I can't see any problematic code though, maybe the
> > Sonnect::Highlighter::eventFilter() handling?
>
> A bit of investigation shows, that the culprit part is Sonnet::Filter.
> Its static instance is used by both, the BackgroundChecker of the dialog
> and the BackgroundChecker of the Highlighter, so the highlighters
> changes the state of the global filter instance and the dialog thinks it
> is already finish with checking and closes itself.
>
> Creating a new Filter in every BackgroundEngine instance solves that
> problem here.
>
>  Zack What's the best way to fix it?


If I'd be after a quick fix I'd probably change Filter* 
Filter::defaultFilter() to look like:
Filter* Filter::defaultFilter()
{
	return new Filter;
}
instead of 
Filter* Filter::defaultFilter()
{
	return s_defFilter;
}
this way filters created by Filter::defaultFilter will have to be deleteted so 
some delete in backgroundengine would be also nice, but it should fix this 
bug.

If I'd be after a longer but proper solution I'd replace Sonnet::Filter with 
QTextBoundaryFinder.

z


More information about the Kdelibs-bugs mailing list