QList<Translation*> XdxfPlugin::searchWordList(QString word, int limit) {
//if(_settings->value("cached") == "true")
+ if(word.indexOf("*")==-1 && word.indexOf("?")==-1 && word.indexOf("_")==-1
+ && word.indexOf("%")==-1)
+ word+="*";
if(isCached())
return searchWordListCache(word,limit);
return searchWordListFile(word, limit);
word = removeAccents(word);
stopped = false;
- if(word.indexOf("*")==-1)
- word+="*";
QRegExp regWord(word);
regWord.setCaseSensitivity(Qt::CaseInsensitive);
regWord.setPatternSyntax(QRegExp::Wildcard);
if(regWord.exactMatch(removeAccents(a)) && (i<limit || limit==0)) {
bool ok=true;
Translation *tran;
- foreach(tran,translations)
- {
+ foreach(tran,translations) {
if(tran->key()==a)
ok=false; /*if key word is in the dictionary more that one */
}
return true;
}
-void XdxfPlugin::setHash(uint _hash)
-{
+void XdxfPlugin::setHash(uint _hash) {
this->_hash=_hash;
}
-uint XdxfPlugin::hash() const
-{
+uint XdxfPlugin::hash() const {
return _hash;
}
return _settings;
}
-bool XdxfPlugin::isCached()
-{
+bool XdxfPlugin::isCached() {
if(_settings->value("cached") == "true")
return true;
return false;
}
QString XdxfPlugin::removeAccents(QString string) {
-
string = string.replace(QString::fromUtf8("ł"), "l", Qt::CaseInsensitive);
QString normalized = string.normalized(QString::NormalizationForm_D);
normalized = normalized;
while (!reader.atEnd() && !stopped) {
QCoreApplication::processEvents();
- //usleep(50);
reader.readNext();
if(reader.tokenType() == QXmlStreamReader::StartElement) {