QSqlQuery cur(db);
if(limit !=0)
- cur.prepare("select word from dict where word like ? limit ?");
+ cur.prepare("select word from dict where word like ? or normalized like ? limit ?");
else
- cur.prepare("select word from dict where word like ?");
+ cur.prepare("select word from dict where word like ? or normalized like ?");
+ cur.addBindValue(word);
cur.addBindValue(word);
if(limit !=0)
cur.addBindValue(limit);
cur.value(0).toString().toLower(),
_infoNote, this));
}
- if(!in) {
-
- QSqlQuery cur(db);
- if(limit !=0)
- cur.prepare("select word from dict where normalized like ? limit ?");
- else
- cur.prepare("select word from dict where normalized like ?");
- cur.addBindValue(word);
- if(limit !=0)
- cur.addBindValue(limit);
- cur.exec();
- while(cur.next()){
- bool ok=true;
- Translation *tran;
- foreach(tran,translations) {
- if(tran->key().toLower()==cur.value(0).toString().toLower())
- ok=false;
- }
- if(ok) /*add key word to list*/
- translations.insert(new TranslationXdxf(
- cur.value(0).toString().toLower(),
- _infoNote, this));
- }
- }
db.close();
return translations.toList();
}