Summary: | Replace in spell dialog closes dialog | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kdelibs | Reporter: | Alan Braslau <alan.braslau> |
Component: | kdeui | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | SVN | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Alan Braslau
2008-07-08 12:41:16 UTC
Yes, confirmed. The spell dialog is in kdelibs (happens also in Konqueror for example), so reassigning this bug to there. That's a bug how KTextEditor is using the replace dialog I guess, since replacing text in kwrite works fine. > That's a bug how KTextEditor is using the replace dialog I guess, since
> replacing text in kwrite works fine.
Hmm, I think this is a problem in KTextEdit / the spell dialog, but not
KTextEditor (which is something Kate-related).
And it's not a problem with the normal replace dialog (that works), but with
the replace function in the spell check dialog, which replaces a misspelled
word with the correct one.
Yeah, meant KTextEdit (without 'or' ;)). The problem only appears if autospellchecking is enabled in KTextEdit. I can't see any problematic code though, maybe the Sonnect::Highlighter::eventFilter() handling? Ciao, Tobias 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?
Ciao,
Tobias
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 SVN commit 829603 by tokoe: Do not use a static filter, as that will cause trouble if more than one backgroundchecker is in action (e.g. highlighter + spellchecking dialog) BUG: 166029 M +1 -0 backgroundengine.cpp M +1 -1 filter.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=829603 |