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++;
}
else
result+="bookmark=\"false\" >";
- qDebug()<<"trans: "<<_trans;
+ //qDebug()<<"trans: "<<_trans;
if(_trans!="")
return result+=_dictionaryInfo+ "</info>"+_trans +"</dict>";
QList<Translation*> translations=googlePlugin->searchWordList(_key);
- qDebug()<<"test: "<<translations.size();
+ //qDebug()<<"test: "<<translations.size();
if(translations.size()>0 && translations.at(0))
return translations.at(0)->toXml();
return "";
void XdxfPlugin::stop() {
+ //qDebug()<<"stop";
stopped=true;
}
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)));
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();