fix bug (duplication of dictionarys in xdxf downloader)
[mdictionary] / src / plugins / stardict / StarDictPlugin.cpp
index e9036ef..4c78fe3 100644 (file)
@@ -43,7 +43,10 @@ StarDictPlugin::StarDictPlugin(QObject *parent) : CommonDictInterface(parent),
     _icon = QIcon("/usr/share/mdictionary/stardict.png");
     stopped = false;
 
+    _settings->setValue("strip_accents","true");
+
     initAccents();
+
 }
 
 
@@ -124,9 +127,9 @@ QList<Translation*> StarDictPlugin::searchWordList(QString word, int limit) {
             offset = reader->readInt64BigEndian();
         len = reader->readInt32BigEndian();
 
-        if(keyword.exactMatch(fkey)) {
+        if(keyword.exactMatch(fkey) ) {
             TranslationStarDict tran(fkey, infoNote(), this);
-  //          qDebug() << "off/len" << offset << len;
+  //        qDebug() << "off/len" << offset << len;
             int id = translations.indexOf(tran);
             if(id == -1) {
                 tran.add(offset, len);
@@ -160,18 +163,18 @@ QByteArray StarDictPlugin::read(QByteArray::iterator it,
 
 
 QString StarDictPlugin::interpret(QByteArray::iterator it,
-        QByteArray::iterator end, QChar mode,QString key, bool last) {
+        QByteArray::iterator end, QChar mode,QString key, bool) {
     QString result;
 //    qDebug()<<"****** mode:     "<<mode;
-    if(mode == 'm' ||
-            mode == 'l' ||
-            mode == 'g' ||
-            mode == 't' ||
-            mode == 'y' ||
-            mode == 'k' ||
-            mode == 'w' ||
-            mode == 'h' ||
-            mode == 'r' ){
+    if(mode == 'm'
+            || mode == 'l'
+            || mode == 'g'
+            || mode == 't'
+            || mode == 'y'
+            || mode == 'k'
+            || mode == 'w'
+            || mode == 'h'
+            || mode == 'r'){
         result += "<key>" + key + "</key>";
         result += "<t>" + QString::fromUtf8(read(it++, end)) + "</t>";
     }