Fixed wildcards hanling
authorBartosz Szatkowski <bulislaw@linux.com>
Fri, 13 Aug 2010 09:16:08 +0000 (11:16 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Fri, 13 Aug 2010 09:16:08 +0000 (11:16 +0200)
trunk/src/plugins/xdxf/src/xdxfplugin.cpp

index 188ea06..f532019 100644 (file)
@@ -84,10 +84,13 @@ QList<Translation*> XdxfPlugin::searchWordListCache(QString word, int limit) {
         }
 
         stopped = false;
-        word = removeAccents(word);
         if(word.indexOf("*")==-1)
             word+="%";
+        qDebug() << word;
         word = word.replace("*", "%");
+        qDebug() << word;
+        word = removeAccents(word);
+        qDebug() << word;
 
         QSqlQuery cur(db);
         cur.prepare("select word from dict where word like ? limit ?");
@@ -292,7 +295,9 @@ QString XdxfPlugin::removeAccents(QString string) {
     for(int i=0; i<normalized.size(); i++) {
         if( !normalized[i].isLetterOrNumber() &&
             !normalized[i].isSpace() &&
-            !normalized[i].isDigit()) {
+            !normalized[i].isDigit() &&
+            normalized[i] != '*' &&
+            normalized[i] != '%') {
             normalized.remove(i,1);
         }
     }