QList<Translation*> XdxfPlugin::searchWordList(QString word, int limit) {
QRegExp regWord(word);
- QList<Translation*> translations;
+ regWord.setCaseSensitivity(Qt::CaseInsensitive);
regWord.setPatternSyntax(QRegExp::Wildcard);
+
+ QList<Translation*> translations;
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
qDebug()<<"Error: could not open file";
a = dictionaryReader.readElementText();
if(regWord.exactMatch(a) && i<limit) {
translations.append(new TranslationXdxf(a,_infoNote,this));
- qDebug()<<a;
i++;
if(i>=limit)
break;
QString XdxfPlugin::search(QString key) {
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
- return ""; //blad otwarcia pliku
+ qDebug()<<"Error: could not open file";
+ return "";
}
QXmlStreamReader dictionaryReader(&dictionaryFile);
match = true;
}
}
- else if(dictionaryReader.tokenType() == QXmlStreamReader::Characters)
+ else if(dictionaryReader.tokenType() == QXmlStreamReader::Characters) {
if(match) {
- dictionaryFile.close();
- qDebug()<<dictionaryReader.text().toString().replace("\n","");
- return dictionaryReader.text().toString().replace("\n","");
+ QString temp(dictionaryReader.text().toString().replace("\n",""));
+ dictionaryFile.close();
+ return temp;
}
+ }
}
return "";
}
}
QDialog* XdxfPlugin::settingsDialog() {
- ;
+ path="dict.xdxf";
}
CommonDictInterface* XdxfPlugin::getNew(const Settings*) const {
+ // CommonDictInterface *commonDictInterface= new
;
}
return true;
}
+void XdxfPlugin::setHash(uint _hash)
+{
+ this->_hash=_hash;
+}
+
uint XdxfPlugin::hash() const
{
- return 1;
+ return _hash;
}