if(dictionaryReader.name()=="description")
_infoNote=dictionaryReader.readElementText();
- /*dictionaryFile.seek(0);
-
- long wordsCount = 0;
-
- QString line;
- while(!dictionaryFile.atEnd()) {
- line = dictionaryFile.readLine();
- if(line.contains("<ar>")) {
- wordsCount++;
- }
- }*/
-
dictionaryFile.close();
}
return &_icon;
}
+int XdxfPlugin::countWords() {
+
+ QFile dictionaryFile(path);
+ if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
+ qDebug()<<"Error: could not open file";
+ return -1;
+ }
+
+ dictionaryFile.seek(0);
+
+ long wordsCount = 0;
+
+ QString line;
+ while(!dictionaryFile.atEnd()) {
+ line = dictionaryFile.readLine();
+ if(line.contains("<ar>")) {
+ wordsCount++;
+ }
+ }
+ _wordsCount = wordsCount;
+ dictionaryFile.close();
+ return wordsCount;
+}
+
Q_EXPORT_PLUGIN2(xdxf, XdxfPlugin)
QList<Translation*> searchWordListCache(QString word, int limit=0);
QList<Translation*> searchWordListFile(QString word, int limit=0);
+ int countWords();
//! language from which we translate
QString _langFrom;