Merge branch 'master' into google
[mdictionary] / src / plugins / xdxf / xdxfplugin.cpp
index e886f23..aad8274 100644 (file)
@@ -320,10 +320,22 @@ DictDialog* XdxfPlugin::dictDialog() {
 CommonDictInterface* XdxfPlugin::getNew(const Settings *settings) const {
     XdxfPlugin *plugin = new XdxfPlugin();
 
+    connect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+            this, SIGNAL(notify(Notify::NotifyType,QString)));
+
+    ((XdxfDictDialog*)plugin->dictDialog())->setLastDialogParent(_dictDialog->lastDialogParent());
+
+
+
     if(settings && plugin->setSettings(settings)) {
+
+        disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+                this, SIGNAL(notify(Notify::NotifyType,QString)));
         return plugin;
     }
     else {
+        disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+                this, SIGNAL(notify(Notify::NotifyType,QString)));
         delete plugin;
         return 0;
     }
@@ -429,9 +441,13 @@ bool XdxfPlugin::getDictionaryInfo() {
     reader.readNextStartElement();
     if(reader.name()=="full_name")
         _name=reader.readElementText();
+    else
+        qDebug()<<"no full_name";
     reader.readNextStartElement();
     if(reader.name()=="description")
         _infoNote=reader.readElementText();
+    else
+        qDebug()<<"no description";
 
     _dictionaryInfo= _name + " [" + _langFrom + "-"
                 + _langTo + "]";
@@ -482,6 +498,8 @@ bool XdxfPlugin::makeCache(QString) {
 
     XdxfCachingDialog d(_dictDialog->lastDialogParent());
 
+    qDebug()<<_dictDialog->lastDialogParent();
+
     connect(&d, SIGNAL(cancelCaching()),
             this, SLOT(stop()));
 
@@ -490,13 +508,6 @@ bool XdxfPlugin::makeCache(QString) {
 
     d.show();
 
-
-  //  cachingDialog->setParent(_dictDialog->lastDialogParent());
- //   #ifdef Q_WS_MAEMO_5
- //       cachingDialog->setVisible(true);
- //   #else
-  //      cachingDialog->exec();
- //   #endif
     QCoreApplication::processEvents();
     QFileInfo dictFileN(_settings->value("path"));
     QString cachePathN;
@@ -600,13 +611,11 @@ bool XdxfPlugin::makeCache(QString) {
             if(prog % 2 == 0 && lastProg != prog) {
                 Q_EMIT updateCachingProgress(prog,timer.restart());
                 lastProg = prog;
-                sleep(1);
             }
         }
     }
     cur.exec("END;");
     cur.exec("select count(*) from dict");
-    //cachingDialog->hide();
 
     /*checke errors (wrong number of added words)*/
     countWords();