From: Jakub Jaszczynski Date: Tue, 14 Sep 2010 11:45:57 +0000 (+0200) Subject: fix bugs (detect lanquage and cancel cache file ) X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=b4240be6f4bb7292ff2efe8c9c83c77401a84c73;p=mdictionary fix bugs (detect lanquage and cancel cache file ) --- diff --git a/src/plugins/google/GoogleDialog.cpp b/src/plugins/google/GoogleDialog.cpp index a7b83ff..75e4368 100644 --- a/src/plugins/google/GoogleDialog.cpp +++ b/src/plugins/google/GoogleDialog.cpp @@ -106,15 +106,19 @@ void GoogleDialog::initializeUI() { langToComboBox = new QComboBox; int i=0; + int j=0; int actualLangTo=0; int actualLangFrom=0; foreach(QString langs, GooglePlugin::languages.keys()){ if(langs==_langTo) - actualLangTo=i; + actualLangTo=j; if(langs==_langFrom) actualLangFrom=i; - langToComboBox->addItem(langs); + if(langs!="Detect langlage"){ + langToComboBox->addItem(langs); + j++; + } langFromComboBox->addItem(langs); i++; } diff --git a/src/plugins/google/TranslationGoogle.cpp b/src/plugins/google/TranslationGoogle.cpp index 2e54ea9..f0355e7 100644 --- a/src/plugins/google/TranslationGoogle.cpp +++ b/src/plugins/google/TranslationGoogle.cpp @@ -57,13 +57,13 @@ QString TranslationGoogle::toXml() const { else result+="bookmark=\"false\" >"; - qDebug()<<"trans: "<<_trans; + //qDebug()<<"trans: "<<_trans; if(_trans!="") return result+=_dictionaryInfo+ ""+_trans +""; QList translations=googlePlugin->searchWordList(_key); - qDebug()<<"test: "<0 && translations.at(0)) return translations.at(0)->toXml(); return ""; diff --git a/src/plugins/xdxf/xdxfplugin.cpp b/src/plugins/xdxf/xdxfplugin.cpp index aad8274..7e4550c 100644 --- a/src/plugins/xdxf/xdxfplugin.cpp +++ b/src/plugins/xdxf/xdxfplugin.cpp @@ -308,6 +308,7 @@ QString XdxfPlugin::searchFile(QString key) { void XdxfPlugin::stop() { + //qDebug()<<"stop"; stopped=true; } @@ -498,11 +499,10 @@ bool XdxfPlugin::makeCache(QString) { XdxfCachingDialog d(_dictDialog->lastDialogParent()); - qDebug()<<_dictDialog->lastDialogParent(); +// qDebug()<<_dictDialog->lastDialogParent(); connect(&d, SIGNAL(cancelCaching()), this, SLOT(stop())); - connect(this, SIGNAL(updateCachingProgress(int,int)), &d, SLOT(updateCachingProgress(int,int))); @@ -624,24 +624,24 @@ bool XdxfPlugin::makeCache(QString) { Q_EMIT notify(Notify::Warning, QString(tr("Database caching error, please try again."))); db.close(); + _settings->setValue("cache_path", cachePathN); + if(stopped) + clean(); + _settings->setValue("cache_path",""); return false; } _settings->setValue("cache_path", cachePathN); _settings->setValue("cached", "true"); - disconnect(&d, SIGNAL(cancelCaching()), this, SLOT(stop())); - disconnect(this, SIGNAL(updateCachingProgress(int,int)), &d, SLOT(updateCachingProgress(int,int))); - db.close(); return true; } - void XdxfPlugin::clean() { if(QFile::exists(_settings->value("cache_path"))) { QFile(_settings->value("cache_path")).remove();