summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpenmatch.cpp
Unidiff
Diffstat (limited to 'inputmethods/handwriting/qimpenmatch.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpenmatch.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/inputmethods/handwriting/qimpenmatch.cpp b/inputmethods/handwriting/qimpenmatch.cpp
index 0d3e25a..a0448b6 100644
--- a/inputmethods/handwriting/qimpenmatch.cpp
+++ b/inputmethods/handwriting/qimpenmatch.cpp
@@ -26,4 +26,5 @@
26#include <qapplication.h> 26#include <qapplication.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <opie2/odebug.h>
28 29
29#include <limits.h> 30#include <limits.h>
@@ -69,5 +70,5 @@ void QIMPenMatch::strokeEntered( QIMPenStroke *st )
69{ 70{
70#ifdef DEBUG_QIMPEN 71#ifdef DEBUG_QIMPEN
71 qDebug( "---------- new stroke -------------" ); 72 odebug << "---------- new stroke -------------" << oendl;
72#endif 73#endif
73 strokes.append( new QIMPenStroke( *st ) ); 74 strokes.append( new QIMPenStroke( *st ) );
@@ -82,10 +83,10 @@ void QIMPenMatch::strokeEntered( QIMPenStroke *st )
82 if ( strokes.count() > 1 && multiCharSet ) { 83 if ( strokes.count() > 1 && multiCharSet ) {
83#ifdef DEBUG_QIMPEN 84#ifdef DEBUG_QIMPEN
84 qDebug( "Matching against multi set" ); 85 odebug << "Matching against multi set" << oendl;
85#endif 86#endif
86 ml = multiCharSet->match( &testChar ); 87 ml = multiCharSet->match( &testChar );
87 } else { 88 } else {
88#ifdef DEBUG_QIMPEN 89#ifdef DEBUG_QIMPEN
89 qDebug( "Matching against single set" ); 90 odebug << "Matching against single set" << oendl;
90#endif 91#endif
91 ml = charSet->match( &testChar ); 92 ml = charSet->match( &testChar );
@@ -98,5 +99,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
98{ 99{
99#ifdef DEBUG_QIMPEN 100#ifdef DEBUG_QIMPEN
100 qDebug( "Entering strokes.count() = %d", strokes.count() ); 101 odebug << "Entering strokes.count() = " << strokes.count() << oendl;
101#endif 102#endif
102 QIMPenCharMatch candidate1 = { INT_MAX, 0 }; 103 QIMPenCharMatch candidate1 = { INT_MAX, 0 };
@@ -108,5 +109,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
108 candidate1 = ml.first(); 109 candidate1 = ml.first();
109#ifdef DEBUG_QIMPEN 110#ifdef DEBUG_QIMPEN
110 qDebug( QString("Candidate1 = %1").arg(QChar(candidate1.penChar->character())) ); 111 odebug << "Candidate1 = " << candidate1.penChar->character() << oendl;
111#endif 112#endif
112 } 113 }
@@ -121,5 +122,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
121 candidate2 = ml2.first(); 122 candidate2 = ml2.first();
122#ifdef DEBUG_QIMPEN 123#ifdef DEBUG_QIMPEN
123 qDebug( QString("Candidate2 = %1").arg(QChar(candidate2.penChar->character())) ); 124 odebug << "Candidate2 = " << candidate2.penChar->character() << oendl;
124#endif 125#endif
125 } 126 }
@@ -143,5 +144,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
143 ml = ml2; 144 ml = ml2;
144#ifdef DEBUG_QIMPEN 145#ifdef DEBUG_QIMPEN
145 qDebug( "** Using Candidate2" ); 146 odebug << "** Using Candidate2" << oendl;
146#endif 147#endif
147 } else { 148 } else {
@@ -152,5 +153,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
152 prevMatchError = candidate1.error; 153 prevMatchError = candidate1.error;
153#ifdef DEBUG_QIMPEN 154#ifdef DEBUG_QIMPEN
154 qDebug( "** Using Candidate1, with erase" ); 155 odebug << "** Using Candidate1, with erase" << oendl;
155#endif 156#endif
156 } 157 }
@@ -163,5 +164,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
163 prevMatchError = candidate1.error; 164 prevMatchError = candidate1.error;
164#ifdef DEBUG_QIMPEN 165#ifdef DEBUG_QIMPEN
165 qDebug( "** Using Candidate1" ); 166 odebug << "** Using Candidate1" << oendl;
166#endif 167#endif
167 } else if ( candidate2.penChar ) { 168 } else if ( candidate2.penChar ) {
@@ -176,15 +177,15 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
176 ml = ml2; 177 ml = ml2;
177#ifdef DEBUG_QIMPEN 178#ifdef DEBUG_QIMPEN
178 qDebug( "** Using Candidate2" ); 179 odebug << "** Using Candidate2" << oendl;
179#endif 180#endif
180 } else { 181 } else {
181 if ( !ml.count() ) { 182 if ( !ml.count() ) {
182#ifdef DEBUG_QIMPEN 183#ifdef DEBUG_QIMPEN
183 qDebug( "** Failed" ); 184 odebug << "** Failed" << oendl;
184#endif 185#endif
185 canErase = FALSE; 186 canErase = FALSE;
186 } else { 187 } else {
187#ifdef DEBUG_QIMPEN 188#ifdef DEBUG_QIMPEN
188 qDebug( "Need more strokes" ); 189 odebug << "Need more strokes" << oendl;
189#endif 190#endif
190 if ( strokes.count() == 1 ) 191 if ( strokes.count() == 1 )
@@ -198,5 +199,5 @@ void QIMPenMatch::processMatches( QIMPenCharMatchList &ml )
198 if ( eraseLast && canErase ) { 199 if ( eraseLast && canErase ) {
199#ifdef DEBUG_QIMPEN 200#ifdef DEBUG_QIMPEN
200 qDebug( "deleting last" ); 201 odebug << "deleting last" << oendl;
201#endif 202#endif
202 emit erase(); 203 emit erase();
@@ -229,10 +230,10 @@ void QIMPenMatch::updateWordMatch( QIMPenCharMatchList &ml )
229 code == Qt::Key_Enter || code == Qt::Key_Return || 230 code == Qt::Key_Enter || code == Qt::Key_Return ||
230 code == Qt::Key_Tab || code == Qt::Key_Escape ) { 231 code == Qt::Key_Tab || code == Qt::Key_Escape ) {
231 //qDebug( "Word Matching: Clearing word" ); 232 //odebug << "Word Matching: Clearing word" << oendl;
232 wordChars.clear(); 233 wordChars.clear();
233 wordMatches.clear(); 234 wordMatches.clear();
234 wordEntered = QString(); 235 wordEntered = QString();
235 } else if ( code == Qt::Key_Backspace ) { 236 } else if ( code == Qt::Key_Backspace ) {
236 //qDebug( "Word Matching: Handle backspace" ); 237 //odebug << "Word Matching: Handle backspace" << oendl;
237 wordChars.removeLast(); 238 wordChars.removeLast();
238 wordEntered.truncate( wordEntered.length() - 1 ); 239 wordEntered.truncate( wordEntered.length() - 1 );
@@ -282,9 +283,9 @@ void QIMPenMatch::matchWords()
282 QListIterator<MatchWord> it( wordMatches); 283 QListIterator<MatchWord> it( wordMatches);
283 for ( ; it.current(); ++it ) { 284 for ( ; it.current(); ++it ) {
284 qDebug( QString("Match word: %1").arg(it.current()->word) ); 285 odebug << "Match word: " << it.current()->word << oendl;
285 } 286 }
286*/ 287*/
287 } 288 }
288 //qDebug( "Possibles: Good %d, total %d", goodMatches, wordMatches.count() ); 289 //odebug << "Possibles: Good " << goodMatches << ", total " << wordMatches.count() << oendl;
289 wordMatches.sort(); 290 wordMatches.sort();
290} 291}