Bug fix: unable download and add xdxf dictionary more than once
[mdictionary] / src / plugins / xdxf / XdxfDictSelectDialog.cpp
index 8abb1f6..4b4a066 100644 (file)
@@ -50,6 +50,15 @@ XdxfDictSelectDialog::XdxfDictSelectDialog(QList<DownloadDict> dicts,
     checkBoxLayout->addWidget(langToLabel);
     checkBoxLayout->addWidget(langTo, 10);
 
+    //here removing already added dictionary
+
+    for (int i = 0; i < dicts.size(); i++){
+        if(QFile::exists(QDir::homePath() + "/.mdictionary/" + dicts[i].title() + ".xdxf")){
+            dicts.removeAt(i);
+            i--;
+        }
+    }
+
     model = new DictsModel(dicts, this);
 
     proxyModel = new DictsProxyModel;