From: Bartosz Szatkowski Date: Thu, 12 Aug 2010 14:47:16 +0000 (+0200) Subject: searching for word list in xdxf plugin refactorized into searching in file and search... X-Git-Tag: 0.4~20^2~35 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=8823dfd9c553d8eef0878d04e83690666b061be5;p=mdictionary searching for word list in xdxf plugin refactorized into searching in file and searchin in cache -> depends whether cache exists. --- diff --git a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp index f5d73d0..8dcff29 100644 --- a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp +++ b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp @@ -66,7 +66,20 @@ QString XdxfPlugin::infoNote() const { return _infoNote; } -QList XdxfPlugin::searchWordList(QString word, int limit) { +QList XdxfPlugin::searchWordList(QString word, int limit) { + if(_settings->value("cached") == "true") + return searchWordListCache(word,limit); + return searchWordListFile(word, limit); +} + +QList XdxfPlugin::searchWordListCache(QString word, int limit) { + + +} + + + +QList XdxfPlugin::searchWordListFile(QString word, int limit) { QSet translations; QFile dictionaryFile(path); diff --git a/trunk/src/plugins/xdxf/src/xdxfplugin.h b/trunk/src/plugins/xdxf/src/xdxfplugin.h index 70998f1..ca1cb4a 100644 --- a/trunk/src/plugins/xdxf/src/xdxfplugin.h +++ b/trunk/src/plugins/xdxf/src/xdxfplugin.h @@ -112,6 +112,9 @@ private: //! sets the path to dictionary file and adds it to settings void setPath(QString); + QList searchWordListCache(QString word, int limit=0); + QList searchWordListFile(QString word, int limit=0); + //! language from which we translate QString _langFrom; //! language to which we translate