Adding single character wildcards
authorBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 07:14:59 +0000 (09:14 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Mon, 16 Aug 2010 07:14:59 +0000 (09:14 +0200)
trunk/src/plugins/xdxf/src/xdxfplugin.cpp

index b33c512..2187447 100644 (file)
@@ -78,10 +78,12 @@ QList<Translation*> XdxfPlugin::searchWordListCache(QString word, int limit) {
         }
 
         stopped = false;
-        if(word.indexOf("*")==-1)
+        if(word.indexOf("*")==-1 && word.indexOf("?")== 0)
             word+="%";
         word = word.replace("*", "%");
+        word = word.replace("?", "_");
         word = removeAccents(word);
+        qDebug() << word;
 
         QSqlQuery cur(db);
         cur.prepare("select word from dict where word like ? limit ?");