changed the return value of searchWordList function
[mdictionary] / trunk / src / plugins / xdxf / src / XdxfPlugin / xdxfplugin.cpp
index 465c62f..4fe57f1 100644 (file)
@@ -29,13 +29,14 @@ QString XdxfPlugin::infoNote() const {
     return  _infoNote;
 }
 
-void XdxfPlugin::searchWordList(QString word, int limit) {
+QList<Translation*> XdxfPlugin::searchWordList(QString word, int limit) {
     QRegExp regWord(word);
     QList<Translation*> translations;
     regWord.setPatternSyntax(QRegExp::Wildcard);
     QFile dictionaryFile(path);
     if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
-        return; //blad otwarcia pliku
+        qDebug()<<"Error: could not open file";
+        return translations;
     }
     QXmlStreamReader dictionaryReader(&dictionaryFile);
     dictionaryReader.readNextStartElement();
@@ -68,8 +69,9 @@ void XdxfPlugin::searchWordList(QString word, int limit) {
         }
     }
     stopped=false;
-    emit finalTranslation(translations);
     dictionaryFile.close();
+    emit finalTranslation();
+    return translations;
 }
 
 QString XdxfPlugin::search(QString key) {