diff --git a/plasma/applet.cpp b/plasma/applet.cpp index 6fa52266d..2396557b7 100644 --- a/plasma/applet.cpp +++ b/plasma/applet.cpp @@ -348,11 +348,6 @@ ConfigLoader *Applet::configScheme() const return d->configLoader; } -DataEngine *Applet::dataEngine(const QString &name) const -{ - return d->dataEngine(name); -} - Package Applet::package() const { return d->package ? *d->package : Package(); diff --git a/plasma/applet.h b/plasma/applet.h index 25d53ad93..9f476ce78 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -223,25 +223,6 @@ class PLASMA_EXPORT Applet : public QObject **/ Package package() const; - /** - * Loads the given DataEngine - * - * Tries to load the data engine given by @p name. Each engine is - * only loaded once, and that instance is re-used on all subsequent - * requests. - * - * If the data engine was not found, an invalid data engine is returned - * (see DataEngine::isValid()). - * - * Note that you should not delete the returned engine. - * - * @param name Name of the data engine to load - * @return pointer to the data engine if it was loaded, - * or an invalid data engine if the requested engine - * could not be loaded - */ - DataEngine *dataEngine(const QString &name) const; - /** * Called when any of the geometry constraints have been updated. * This method calls constraintsEvent, which may be reimplemented, diff --git a/plasma/private/applet_p.h b/plasma/private/applet_p.h index 47183df5e..d2c449848 100644 --- a/plasma/private/applet_p.h +++ b/plasma/private/applet_p.h @@ -31,7 +31,6 @@ #include #include "plasma/applet.h" -#include "plasma/dataengineconsumer.h" class KKeySequenceWidget; @@ -74,7 +73,7 @@ private: bool m_changed; }; -class PLASMA_EXPORT AppletPrivate : public DataEngineConsumer +class PLASMA_EXPORT AppletPrivate { public: AppletPrivate(KService::Ptr service, const KPluginInfo *info, int uniqueID, Applet *applet); diff --git a/plasma/scripting/appletscript.cpp b/plasma/scripting/appletscript.cpp index 2a859c570..4fc665033 100644 --- a/plasma/scripting/appletscript.cpp +++ b/plasma/scripting/appletscript.cpp @@ -141,12 +141,6 @@ void AppletScript::configChanged() { } -DataEngine *AppletScript::dataEngine(const QString &engine) const -{ - Q_ASSERT(d->applet); - return d->applet->dataEngine(engine); -} - QString AppletScript::mainScript() const { Q_ASSERT(d->applet); diff --git a/plasma/scripting/appletscript.h b/plasma/scripting/appletscript.h index 764bd1bd8..677d83ad5 100644 --- a/plasma/scripting/appletscript.h +++ b/plasma/scripting/appletscript.h @@ -176,12 +176,6 @@ public Q_SLOTS: virtual void configChanged(); protected: - /** - * @param engine name of the engine - * @return a data engine associated with this plasmoid - */ - Q_INVOKABLE DataEngine *dataEngine(const QString &engine) const; - /** * @return absolute path to the main script file for this plasmoid */ diff --git a/scriptengines/qml/plasmoid/appletinterface.cpp b/scriptengines/qml/plasmoid/appletinterface.cpp index fe3e52e4f..b6be300ed 100644 --- a/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/scriptengines/qml/plasmoid/appletinterface.cpp @@ -65,11 +65,6 @@ AppletInterface::~AppletInterface() { } -Plasma::DataEngine* AppletInterface::dataEngine(const QString &name) -{ - return applet()->dataEngine(name); -} - AppletInterface::FormFactor AppletInterface::formFactor() const { return static_cast(applet()->formFactor()); diff --git a/scriptengines/qml/plasmoid/appletinterface.h b/scriptengines/qml/plasmoid/appletinterface.h index b1e7d2ed5..8deb55090 100644 --- a/scriptengines/qml/plasmoid/appletinterface.h +++ b/scriptengines/qml/plasmoid/appletinterface.h @@ -28,7 +28,6 @@ #include #include -#include #include #include "declarativeappletscript.h" @@ -243,8 +242,6 @@ enum IntervalAlignment { Q_INVOKABLE void debug(const QString &msg); - Plasma::DataEngine *dataEngine(const QString &name); - QList contextualActions() const; bool immutable() const; bool userConfiguring() const; diff --git a/scriptengines/qml/plasmoid/declarativeappletscript.cpp b/scriptengines/qml/plasmoid/declarativeappletscript.cpp index e8509e885..b548b9b10 100644 --- a/scriptengines/qml/plasmoid/declarativeappletscript.cpp +++ b/scriptengines/qml/plasmoid/declarativeappletscript.cpp @@ -38,7 +38,7 @@ #include #include #include - +#include #include "plasmoid/declarativeappletscript.h" @@ -251,20 +251,6 @@ void DeclarativeAppletScript::popupEvent(bool popped) m_env->callEventListeners("popupEvent", args); } -void DeclarativeAppletScript::dataUpdated(const QString &name, const Plasma::DataEngine::Data &data) -{ -#if 0 -TODO: callEventListeners is broken without qscriptengine - if (!m_engine) { - return; - } - QScriptValueList args; - args << m_engine->toScriptValue(name) << m_engine->toScriptValue(data); - - m_env->callEventListeners("dataUpdated", args); -#endif -} - void DeclarativeAppletScript::activate() { #if 0 @@ -342,7 +328,6 @@ TODO: make this work with QQmlEngine //Make enum values accessible also as plasmoid.Planar etc ScriptEnv::registerEnums(m_self, AppletInterface::staticMetaObject); - global.setProperty("dataEngine", m_engine->newFunction(DeclarativeAppletScript::dataEngine)); global.setProperty("service", m_engine->newFunction(DeclarativeAppletScript::service)); global.setProperty("loadService", m_engine->newFunction(DeclarativeAppletScript::loadService)); @@ -369,17 +354,6 @@ TODO: make this work with QQmlEngine #endif } -QObject *DeclarativeAppletScript::dataEngine(const QString &dataEngineName) -{ - return applet()->dataEngine(dataEngineName); -} - -QObject *DeclarativeAppletScript::service(const QString &dataEngine, const QString &source) -{ - Plasma::DataEngine *data = applet()->dataEngine(dataEngine); - return data->serviceForSource(source); -} - QObject *DeclarativeAppletScript::loadService(const QString &pluginName) { return Plasma::PluginLoader::self()->loadService(pluginName, QVariantList(), applet()); diff --git a/scriptengines/qml/plasmoid/declarativeappletscript.h b/scriptengines/qml/plasmoid/declarativeappletscript.h index 053c1761d..3da0aa93c 100644 --- a/scriptengines/qml/plasmoid/declarativeappletscript.h +++ b/scriptengines/qml/plasmoid/declarativeappletscript.h @@ -27,7 +27,6 @@ #include #include "plasmoid/appletauthorization.h" -#include class AppletInterface; @@ -55,13 +54,10 @@ public: QQmlEngine *engine() const; static QObject *loadui(const QString &filename); - QObject *dataEngine(const QString &dataEngineName); - QObject *service(const QString &dataEngine, const QString &source); QObject *loadService(const QString &pluginName); public Q_SLOTS: void executeAction(const QString &name); - void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data); //void signalHandlerException(const QObject &exception); void popupEvent(bool popped); void activate();