_wordsCount = -1;
_settings = new Settings();
_dictDialog = new XdxfDictDialog(this, this);
+ cachingDialog = new XdxfCachingDialog(this);
+
_settings->setValue("type","xdxf");
- if(isCached())
- _settings->setValue("cached","true");
- else
- _settings->setValue("cached","false");
-
stopped = false;
bool XdxfPlugin::makeCache(QString dir) {
+ cachingDialog->setVisible(true);
+ QCoreApplication::processEvents();
+ stopped = false;
QFileInfo dictFileN(_settings->value("path"));
QString cachePathN;
cachePathN = QDir::homePath() + "/.mdictionary/"
counter=0;
- while (!reader.atEnd()) {
+ while (!reader.atEnd() && !stopped) {
+ QCoreApplication::processEvents();
+ //usleep(50);
reader.readNext();
if(reader.tokenType() == QXmlStreamReader::StartElement) {
}
}
-
- qDebug()<<counter;
cur.exec("END;");
cur.exec("select count(*) from dict");
+
+ countWords();
+ cachingDialog->setVisible(false);
+
if(!cur.next() || countWords() != cur.value(0).toInt())
return false;
_settings->setValue("cache_path", cachePathN);