Merge branch 'master' of ssh://drop.maemo.org/git/mdictionary into gui
[mdictionary] / trunk / src / base / backbone / backbone.cpp
index ab5c2f7..c0803f4 100644 (file)
 // Created by Bartosz Szatkowski
 
 #include "backbone.h"
-
+#include <QDebug>
 Backbone::Backbone(QObject *parent)
     : QObject(parent)
 {
    searchLimitv = 10;
+   loadPlugins();
 }
 
 
@@ -135,9 +136,15 @@ void Backbone::search(QString word) {
 
  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
  }
 
 
@@ -158,7 +165,10 @@ int Backbone::activeSearches() const {
 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();
@@ -168,9 +178,15 @@ void Backbone::translation(QList<Translation *> trans) {
 
 
 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);