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

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui/sonnet
From:       Zack Rusin <zack () kde ! org>
Date:       2008-08-30 8:49:44
Message-ID: 200808300449.44335.zack () kde ! org
[Download RAW message or body]

On Thursday 28 August 2008 19:13:02 Allen Winter wrote:
> On Monday 25 August 2008 15:59:02 Zack Rusin wrote:
> > SVN commit 852365 by zack:
>
> Zack,
>
> I can't compose anymore due to this change.  Both KMail and Konqueror
> composers segfault in Qt.  Attached is the most I can get from a backtrace
> without compiling Qt with full debugging.  But I know we get as far as
> rehighlight() from Highlighter::slotRehighlight().
>
> If I put back the old way in Highlighter::setMisspelled, then things work
> again. I don't know if your code is the problem, or something in Qt.
>
> Please do something quickly to fix this if you can.

Unfortunately I can't. I can't reproduce it but from the backtrace this looks 
like a qstroker problem when stroking the wavy underline. If this is present 
in the latest Qt then this is a /serious/ bug there and we need to fix it in 
qstroker.cpp. Unless someone can get me a full backtrace with the latest qt-
copy then there's not a whole lot I can do (you can back it out from 4.1 and 
leave it in HEAD until someone can hook me up with a latest backtrace)

z

> -Allen
>
> > underline using a squiggly line instead of red color
> > also be a little smarter about auto-disabling
> > BUG: 116137
> >
> >  M  +25 -30    highlighter.cpp
> >
> >
> > --- trunk/KDE/kdelibs/kdeui/sonnet/highlighter.cpp #852364:852365
> > @@ -33,14 +33,16 @@
> >  #include <klocale.h>
> >  #include <kmessagebox.h>
> >
> > -#include <QtGui/QTextEdit>
> > -#include <QtCore/QTimer>
> > -#include <QtGui/QColor>
> > +#include <QTextEdit>
> > +#include <QTextCharFormat>
> > +#include <QTimer>
> > +#include <QColor>
> >  #include <QHash>
> >  #include <QTextCursor>
> >  #include <QEvent>
> >  #include <QKeyEvent>
> >  #include <QApplication>
> > +
> >  namespace Sonnet {
> >
> >  class Highlighter::Private
> > @@ -213,21 +215,23 @@
> >  {
> >      bool savedActive = d->active;
> >
> > -    if ( d->automatic ) {
> > +    //don't disable just because 1 of 4 is misspelled.
> > +    if (d->automatic && d->wordCount >= 10) {
> >  	// tme = Too many errors
> > -        bool tme = ( d->errorCount >= d->disableWordCount ) && (
> > d->errorCount * 100 >= d->disablePercentage * d->wordCount ); -	if (
> > d->active && tme )
> > +        bool tme = (d->errorCount >= d->disableWordCount) && (
> > +            d->errorCount * 100 >= d->disablePercentage * d->wordCount);
> > +	if (d->active && tme)
> >  	    d->active = false;
> > -	else if ( !d->active && !tme )
> > +	else if (!d->active && !tme)
> >  	    d->active = true;
> >      }
> > -    if ( d->active != savedActive ) {
> > -	if ( d->wordCount > 1 )
> > +    if (d->active != savedActive) {
> > +	if (d->wordCount > 1)
> >  	    if ( d->active )
> > -		emit activeChanged( i18n("As-you-type spell checking enabled.") );
> > +		emit activeChanged(i18n("As-you-type spell checking enabled."));
> >  	    else
> > -		emit activeChanged( i18n( "Too many misspelled words. "
> > -					  "As-you-type spell checking disabled." ) );
> > +		emit activeChanged(i18n( "Too many misspelled words. "
> > +                                         "As-you-type spell checking
> > disabled.")); d->completeRehighlightRequired = true;
> >  	d->rehighlightRequest->setInterval(100);
> >          d->rehighlightRequest->setSingleShot(true);
> > @@ -255,15 +259,15 @@
> >      return d->active;
> >  }
> >
> > -void Highlighter::highlightBlock ( const QString & text )
> > +void Highlighter::highlightBlock(const QString &text)
> >  {
> > -    if ( text.isEmpty() || !d->active || !d->spellCheckerFound)
> > +    if (text.isEmpty() || !d->active || !d->spellCheckerFound)
> >          return;
> >      QTextCursor cursor = d->edit->textCursor();
> >      int index = cursor.position();
> >
> >      const int lengthPosition = text.length() - 1;
> > -
> > +
> >      if ( index != lengthPosition ||
> >           ( lengthPosition > 0 && !text[lengthPosition-1].isLetter() ) )
> > { d->filter->setBuffer( text );
> > @@ -313,12 +317,16 @@
> >
> >  void Highlighter::setMisspelled(int start, int count)
> >  {
> > -    setFormat(start, count, d->spellColor);
> > +    QTextCharFormat format;
> > +    format.setFontUnderline(true);
> > +    format.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline);
> > +    format.setUnderlineColor(d->spellColor);
> > +    setFormat(start, count, format);
> >  }
> >
> >  void Highlighter::unsetMisspelled( int start, int count )
> >  {
> > -    setFormat( start, count, qApp->palette().color( QPalette::Text ) );
> > +    setFormat(start, count, qApp->palette().color(QPalette::Text));
> >  }
> >
> >  bool Highlighter::eventFilter( QObject *o, QEvent *e)
> > @@ -396,19 +404,6 @@
> >      return false;
> >  }
> >
> > -
> > -/*
> > -  void Highlighter::checkWords()
> > -  {
> > -  Word w = d->filter->nextWord();
> > -  if ( !w.end ) {
> > -  if ( !d->dict->check( w.word ) ) {
> > -  setFormat( w.start, w.word.length(),
> > -  Qt::red );
> > -  }
> > -  }
> > -  }*/
> > -
> >  void Highlighter::addWordToDictionary(const QString &word)
> >  {
> >      d->dict->addToPersonal(word);

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

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