diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index eaccd5f83..7a0f782ee 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -136,26 +136,6 @@ DataContainer *DataEngine::containerForSource(const QString &source) return d->source(source, false); } -DataEngine::Data DataEngine::query(const QString &source) const -{ - bool newSource; - DataContainer *s = d->requestSource(source, &newSource); - - if (!s) { - return DataEngine::Data(); - } else if (!newSource && d->minPollingInterval >= 0 && - s->timeSinceLastUpdate() >= uint(d->minPollingInterval)) { - DataEngine *unconstThis = const_cast(this); - if (unconstThis->updateSourceEvent(source)) { - unconstThis->scheduleSourcesUpdated(); - } - } - - DataEngine::Data data = s->data(); - s->d->checkUsage(); - return data; -} - void DataEngine::init() { if (d->script) { @@ -385,15 +365,6 @@ void DataEngine::forceImmediateUpdateOfAllVisualizations() } } -QString DataEngine::pluginName() const -{ - if (!d->dataEngineDescription.isValid()) { - return QString(); - } - - return d->dataEngineDescription.pluginName(); -} - void DataEngine::setDefaultService(const QString &serviceName) { d->serviceName = serviceName; diff --git a/src/plasma/dataengine.h b/src/plasma/dataengine.h index aec984a45..d46be21c1 100644 --- a/src/plasma/dataengine.h +++ b/src/plasma/dataengine.h @@ -184,18 +184,6 @@ NoAlignment) const; **/ Q_INVOKABLE DataContainer *containerForSource(const QString &source); - /** - * Gets the Data associated with a data source. - * - * The data is a QHash of QVariants keyed by QString names, allowing - * one data source to provide sets of related data. - * - * @param source the data source to retrieve the data for - * @return the Data associated with the source; if the source doesn't - * exist an empty data set is returned - **/ - Q_INVOKABLE DataEngine::Data query(const QString &source) const; - /** * Returns true if this engine is valid, otherwise returns false * @@ -224,11 +212,6 @@ NoAlignment) const; **/ Package package() const; - /** - * @return the plugin name for the applet - */ - QString pluginName() const; - /** * Initializes and returns a new service from the name that was set * with setDefaultService. (service name is set internally). Remember to dispose diff --git a/src/plasma/private/storage.cpp b/src/plasma/private/storage.cpp index 9618a972a..987ab330f 100644 --- a/src/plasma/private/storage.cpp +++ b/src/plasma/private/storage.cpp @@ -135,7 +135,7 @@ Storage::Storage(QObject* parent) Plasma::DataEngine *engine = qobject_cast(parentObject); if (engine) { - m_clientName = engine->pluginName(); + m_clientName = engine->pluginInfo().pluginName(); break; } diff --git a/src/shell/scripting/appinterface.cpp b/src/shell/scripting/appinterface.cpp index 40e19eb04..a7e00313b 100644 --- a/src/shell/scripting/appinterface.cpp +++ b/src/shell/scripting/appinterface.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include #include #include @@ -159,12 +161,7 @@ void AppInterface::sleep(int ms) bool AppInterface::hasBattery() const { - Plasma::DataEngineConsumer *consumer = new Plasma::DataEngineConsumer(); - Plasma::DataEngine *power = consumer->dataEngine("powermanagement"); - - const QStringList batteries = power->query("Battery")["Sources"].toStringList(); - delete consumer; - return !batteries.isEmpty(); + return !Solid::Device::listFromType(Solid::DeviceInterface::Battery).isEmpty(); } QStringList AppInterface::knownWidgetTypes() const