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

List:       kde-commits
Subject:    branches/KDE/3.4/kdelibs/kdeui
From:       John Tapsell <john.tapsell () kdemail ! net>
Date:       2005-08-01 18:48:51
Message-ID: 1122922131.567700.24064.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 442135 by johnflux:

Backport to 3.4 on request by jacubS

There was a bug where textedit says too many misspelt words and turns 
off when you have only written 1 or 2 words!  So I wrote a patch..  After 
discussing with the others, we agree a default of 100 words minimum before it 
can be disabled.




 M  +3 -1      ksyntaxhighlighter.cpp  


--- branches/KDE/3.4/kdelibs/kdeui/ksyntaxhighlighter.cpp #442134:442135
@@ -102,6 +102,7 @@
     int wordCount, errorCount;
     int checksRequested, checksDone;
     int disablePercentage;
+    int disableWordCount;
     bool completeRehighlightRequired;
     bool active, automatic, autoReady;
     bool globalConfig, spellReady;
@@ -293,6 +294,7 @@
     KConfigGroupSaver cs( config, "KSpell" );
     d->disablePercentage = config->readNumEntry( \
"KSpell_AsYouTypeDisablePercentage", 42 );  d->disablePercentage = QMIN( \
d->disablePercentage, 101 ); +    d->disableWordCount = config->readNumEntry( \
"KSpell_AsYouTypeDisableWordCount", 100 );  
     textEdit->installEventFilter( this );
     textEdit->viewport()->installEventFilter( this );
@@ -565,7 +567,7 @@
 
     if ( d->automatic ) {
 	// tme = Too many errors
-	bool tme = d->errorCount * 100 >= d->disablePercentage * d->wordCount;
+	bool tme = d->wordCount >= d->disableWordCount && d->errorCount * 100 >= \
d->disablePercentage * d->wordCount;  if ( d->active && tme )
 	    d->active = false;
 	else if ( !d->active && !tme )


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

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