searching for word list in xdxf plugin refactorized into searching in file and search...
authorBartosz Szatkowski <bulislaw@linux.com>
Thu, 12 Aug 2010 14:47:16 +0000 (16:47 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Thu, 12 Aug 2010 14:47:16 +0000 (16:47 +0200)
trunk/src/plugins/xdxf/src/xdxfplugin.cpp
trunk/src/plugins/xdxf/src/xdxfplugin.h

index f5d73d0..8dcff29 100644 (file)
@@ -66,7 +66,20 @@ QString XdxfPlugin::infoNote() const {
     return  _infoNote;
 }
 
-QList<Translation*> XdxfPlugin::searchWordList(QString word, int limit) { 
+QList<Translation*> XdxfPlugin::searchWordList(QString word, int limit) {
+    if(_settings->value("cached") == "true")
+        return searchWordListCache(word,limit);
+    return searchWordListFile(word, limit);
+}
+
+QList<Translation*> XdxfPlugin::searchWordListCache(QString word, int limit) {
+
+
+}
+
+
+
+QList<Translation*> XdxfPlugin::searchWordListFile(QString word, int limit) {
     QSet<Translation*> translations;
     QFile dictionaryFile(path);
 
index 70998f1..ca1cb4a 100644 (file)
@@ -112,6 +112,9 @@ private:
 //! sets the path to dictionary file and adds it to settings
     void setPath(QString);
 
+    QList<Translation*> searchWordListCache(QString word, int limit=0);
+    QList<Translation*> searchWordListFile(QString word, int limit=0);
+
     //! language from which we translate
     QString _langFrom;
     //! language to which we translate