#include "xdxfplugin.h"
#include <QDebug>
-#include <QFile>
-#include <QXmlStreamReader>
-#include <QtPlugin>
-#include "TranslationXdxf.h"
-#include "../../../includes/settings.h"
#include "../../../includes/Notify.h"
XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent),
XdxfPlugin::~XdxfPlugin()
{
- db.removeDatabase(_type+path);
+// QString connection(db.connectionName());
+// db.close();
+// QSqlDatabase::removeDatabase(connection);
+
+ delete _settings;
}
QString XdxfPlugin::langFrom() const {
_infoNote, this));
}
db.close();
- return translations.toList();
+ return translations.toList();
}
QList<Translation*> XdxfPlugin::searchWordListFile(QString word, int limit) {
cur.exec();
while(cur.next())
result += cur.value(0).toString();
+
db.close();
+
return result;
}
return "";
}
QXmlStreamReader reader(&dictionaryFile);
-
-
-
QString a;
bool match =false;
a=a+1;
plugin->db_name = plugin->_settings->value("type")
- + plugin->_settings->value("path");
-// if(!plugin->db.connectionName().isEmpty() || settings->value("generateCache")=="true")
- plugin->db = QSqlDatabase::addDatabase("QSQLITE", plugin->db_name);
+ + plugin->_settings->value("path");
+ plugin->db = QSqlDatabase::addDatabase("QSQLITE", plugin->db_name);
if(settings->value("cached").isEmpty() &&
settings->value("generateCache") == "true") {
QString format = "png";
QString initialPath = QDir::currentPath() + tr("/xdxf.") + format;
- _infoNote="<info path=\""+initialPath+"\">"+"\n" + _name + " [" + _langFrom + "-" + _langTo + "] "+ "(" + _type + ")" + "</info>";
-
-
+ _infoNote="path=\""+initialPath+"\">"+"\n" + _name + " [" + _langFrom + "-" + _langTo + "] "+ "(" + _type + ")";
dictionaryFile.close();
}
_settings->setValue("cache_path", cachePathN);
_settings->setValue("cached", "true");
+
db.close();
return true;
}