From bed3980eba3b67bbe6f40f60f9411dd8240cff84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Mon, 29 Jul 2013 17:22:59 +0200 Subject: [PATCH] Add macro for metadata handling, clean up --- src/plasma/dataengine.cpp | 11 ++--------- src/plasma/dataengine.h | 5 +++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index 012e7926f..918081fcb 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -22,7 +22,6 @@ #include "private/datacontainer_p.h" #include -#include #include #include #include @@ -57,7 +56,6 @@ DataEngine::DataEngine(const KPluginInfo &plugin, QObject *parent) d->setupScriptSupport(); d->script->init(); } else { - // kDebug() << "called"; // default implementation does nothing. this is for engines that have to // start things in motion external to themselves before they can work } @@ -69,12 +67,9 @@ DataEngine::DataEngine(QObject* parent, const QVariantList &args) if (d->script) { d->setupScriptSupport(); d->script->init(); - } else { - // kDebug() << "called"; - // default implementation does nothing. this is for engines that have to - // start things in motion external to themselves before they can work } - + qDebug() << "PWC dataengine: " << d->dataEngineDescription.isValid() << d->dataEngineDescription.name(); + qDebug() << "PWC args: " << args; } DataEngine::~DataEngine() @@ -399,10 +394,8 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info, con if (dataEngineDescription.isValid()) { e->setObjectName(dataEngineDescription.name()); - qDebug() << "Plugininfo is valid! :-)"; } else { e->setObjectName("NullEngine"); - qDebug() << "Plugininfo is INVALID! :-)"; } if (dataEngineDescription.isValid()) { diff --git a/src/plasma/dataengine.h b/src/plasma/dataengine.h index 98ef8c7dd..4778c8560 100644 --- a/src/plasma/dataengine.h +++ b/src/plasma/dataengine.h @@ -432,6 +432,11 @@ K_PLUGIN_FACTORY(factory, registerPlugin();) \ K_EXPORT_PLUGIN(factory("plasma_engine_" #libname)) \ K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) +#define K_EXPORT_PLASMA_DATAENGINE_WITH_METADATA(libname, classname, jsonFile) \ +K_PLUGIN_FACTORY_WITH_METADATA(factory, jsonFile, registerPlugin();) \ +K_EXPORT_PLUGIN(factory("plasma_engine_" #libname)) \ +K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION) + Q_DECLARE_METATYPE(Plasma::DataEngine*) #endif // multiple inclusion guard