remove Applet:dataEngine

This commit is contained in:
Marco Martin 2013-02-12 11:14:14 +01:00
parent 00bb07651b
commit bd9e863c6d
9 changed files with 2 additions and 77 deletions

View File

@ -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();

View File

@ -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 <em>not</em> 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,

View File

@ -31,7 +31,6 @@
#include <kplugininfo.h>
#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);

View File

@ -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);

View File

@ -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
*/

View File

@ -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<FormFactor>(applet()->formFactor());

View File

@ -28,7 +28,6 @@
#include <Plasma/Applet>
#include <Plasma/Containment>
#include <Plasma/DataEngine>
#include <Plasma/Theme>
#include "declarativeappletscript.h"
@ -243,8 +242,6 @@ enum IntervalAlignment {
Q_INVOKABLE void debug(const QString &msg);
Plasma::DataEngine *dataEngine(const QString &name);
QList<QAction*> contextualActions() const;
bool immutable() const;
bool userConfiguring() const;

View File

@ -38,7 +38,7 @@
#include <Plasma/Applet>
#include <Plasma/Package>
#include <Plasma/PluginLoader>
#include <Plasma/Service>
#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());

View File

@ -27,7 +27,6 @@
#include <Plasma/AppletScript>
#include "plasmoid/appletauthorization.h"
#include <Plasma/DataEngine>
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();