if(settings){
plugin->setPath(settings->value("path"));
QStringList list = settings->keys();
- foreach(QString key, list)
- plugin->settings()->setValue(key, settings->value(key));
plugin->db_name = plugin->_settings->value("type")
+ plugin->_settings->value("path");
settings->value("generateCache") == "true") {
plugin->makeCache("");
}
+ foreach(QString key, list)
+ if(key != "generateCache")
+ plugin->settings()->setValue(key, settings->value(key));
delete settings;
}
plugin->getDictionaryInfo();
return true;
}
+
+
void XdxfPlugin::setHash(uint _hash) {
this->_hash=_hash;
}
+
+
uint XdxfPlugin::hash() const {
return _hash;
}
+
+
Settings* XdxfPlugin::settings() {
return _settings;
}
+
+
bool XdxfPlugin::isCached() {
if(_settings->value("cached") == "true")
return true;
return false;
}
+
+
void XdxfPlugin::setSettings(Settings *settings) {
QString oldPath = _settings->value("path");
setPath(settings->value("path"));
}
+ foreach(QString key, settings->keys())
+ if(key != "generateCache")
+ _settings->setValue(key, settings->value(key));
+
if((_settings->value("cached") == "false" ||
- _settings->value("cached").isEmpty()) &&
- settings->value("generateCache") == "true") {
+ _settings->value("cached").isEmpty()) &&
+ settings->value("generateCache") == "true") {
makeCache("");
}
- else {
+ else if (settings->value("generateCache") != "true") {
_settings->setValue("cached", "false");
}
- foreach(QString key, settings->keys())
- if(key != "generateCache")
- _settings->setValue(key, settings->value(key));
+
+
delete settings;
Q_EMIT settingsChanged();
}
+
+
void XdxfPlugin::getDictionaryInfo() {
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
}
QXmlStreamReader reader(&dictionaryFile);
+
db.setDatabaseName(cachePathN);
if(!db.open()) {
qDebug() << "Database error" << db.lastError().text() << endl;
int lastProg = -1;
+ QString stripAcc = settings()->value("strip_accents");
+ settings()->setValue("strip_accents", "true");
+
counter=0;
while (!reader.atEnd() && !stopped) {
cur.exec("END;");
cur.exec("select count(*) from dict");
+ settings()->setValue("strip_accents", stripAcc);
countWords();
cachingDialog->setVisible(false);