// Created by Bartosz Szatkowski
#include "backbone.h"
-
+#include <QDebug>
Backbone::Backbone(QObject *parent)
: QObject(parent)
{
searchLimitv = 10;
+ loadPlugins();
}
foreach(CommonDictInterface* dict, dicts.keys())
if(dicts[dict] == 1) {
- dict->search(word, searchLimit());
+ dict->searchWordList(word, searchLimit());
}
}
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);
this->backbone = backbone;
ui->setupUi(this);
- setAttribute(Qt::WA_Maemo5StackedWindow);
+ // setAttribute(Qt::WA_Maemo5StackedWindow);
searchBarWidget = new SearchBarWidget(backbone);
wordListWidget = new WordListWidget(backbone);
this->backbone = backbone;
- setAttribute(Qt::WA_Maemo5StackedWindow);
+ //setAttribute(Qt::WA_Maemo5StackedWindow);
setWindowFlags(windowFlags() | Qt::Window);
initializeUI();
#include "translation.h"
class Settings;
-Q_DECLARE_INTERFACE (CommonDictInterface, "xdxfInterface")
//! Interface for dict engines plugins
class CommonDictInterface : public QObject {
TARGET = XdxfPlugin
-TEMPLATE = app
+TEMPLATE = lib
SOURCES += \
xdxfplugin.cpp \
#include <QDebug>
#include <QFile>
#include <QXmlStreamReader>
+#include <QtPlugin>
XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent),
_langFrom(tr("")), _langTo(tr("")),_name(tr("")),
return true;
}
+Q_EXPORT_PLUGIN2(xdxf, XdxfPlugin)