// Created by Bartosz Szatkowski
#include "backbone.h"
-
+#include <QDebug>
Backbone::Backbone(QObject *parent)
: QObject(parent)
{
searchLimitv = 10;
+ loadPlugins();
}
void Backbone::addDictionary(CommonDictInterface* dict) {
dicts[dict] = 1;
+<<<<<<< HEAD
+ connect(dict, SIGNAL(finalTranslation(QList<Translation*>)),
+ this, SLOT(translation(QList<Translation*>)),
+ Qt::QueuedConnection);
+=======
//connect(dict, SIGNAL(finalTranslation()),
// this, SLOT(translation()),
// Qt::UniqueConnection);
+>>>>>>> 22b7c270de4fcb536e0325485e69952ea88ebff7
}
void Backbone::translation(QList<Translation *> trans) {
activeSearchNum--;
foreach(Translation* t, trans)
+ {
_result.insert(t->key(), t);
+ qDebug()<<t->key();
+ }
if(activeSearchNum < 1)
Q_EMIT ready();
void Backbone::loadPlugins() {
- QObject *pl = QPluginLoader("xdxf.so").instance();
- if(!pl)
+ QPluginLoader loader("xdxf.so");
+ if(!loader.load())
+ {
+ qDebug()<<loader.errorString();
return;
+ }
+ QObject *pl = loader.instance();
+
+ qDebug()<<"loaded";
CommonDictInterface *plugin = qobject_cast<CommonDictInterface*>(pl);
plugins.append(plugin);
addDictionary(plugin);