X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fplugins%2Fxdxf%2Fxdxfplugin.cpp;h=aad8274f27bf0c72cff3d14962c5d319e424ad51;hb=14cb9cc957bcdc9c39af54ba168c6816a1910a2d;hp=e886f23a06ea298fd05a189825b26643419b8cd1;hpb=c800656bedb514744efe11829b909d0efb95c793;p=mdictionary diff --git a/src/plugins/xdxf/xdxfplugin.cpp b/src/plugins/xdxf/xdxfplugin.cpp index e886f23..aad8274 100644 --- a/src/plugins/xdxf/xdxfplugin.cpp +++ b/src/plugins/xdxf/xdxfplugin.cpp @@ -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();