- void Backbone::addInternalDictionary(CommonDictInterface* dict, bool active) {
- dict->setHash(++_dictNum); // Hash must be uniqe in every session but not between
- _dicts[dict] = active;
- connect(dict, SIGNAL(settingsChanged()), this, SLOT(dictUpdated()));
- connect(dict, SIGNAL(notify(Notify::NotifyType,QString)), this,
- SIGNAL(notify(Notify::NotifyType,QString)));
- }
+void Backbone::addInternalDictionary(CommonDictInterface* dict, bool active) {
+ if(dict) {
+ dict->setHash(++_dictNum); // Hash must be uniqe in every session but not between
+ _dicts[dict] = active;
+ connect(dict, SIGNAL(settingsChanged()), this, SLOT(dictUpdated()));
+ connect(dict, SIGNAL(notify(Notify::NotifyType,QString)), this,
+ SIGNAL(notify(Notify::NotifyType,QString)));
+ }
+}
return plugin;
else {
delete plugin;
- return new XdxfPlugin();
+ return 0;
}
}
if(settings) {
bool isPathChange=false;
QString oldPath = _settings->value("path");
+ Settings *oldSettings = new Settings ;
+
if(oldPath != settings->value("path")) {
if(oldPath!="" && _settings->value("cache_path")!="")
clean();
isPathChange=true;
}
+ foreach(QString key, _settings->keys())
+ oldSettings->setValue(key, _settings->value(key));
+
foreach(QString key, settings->keys()) {
if(key != "generateCache")
_settings->setValue(key, settings->value(key));
Q_EMIT notify(Notify::Warning,
QString(tr("XDXF file is in wrong format")));
qDebug()<<"Error: xdxf file is in wrong format";
+ delete _settings;
+ _settings=oldSettings;
return false;
}