From e7106d2422b109e30554365e44055e125af30343 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 15 Jul 2011 13:01:17 +0200 Subject: [PATCH] no longer provide access to the package from the class, let Package do that; adapt to Package merge --- dataengine.cpp | 14 ++++++++------ dataengine.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dataengine.cpp b/dataengine.cpp index 1f7cadc62..1cd964d7e 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -473,9 +473,9 @@ bool DataEnginePrivate::isPublished() const } } -const Package *DataEngine::package() const +Package DataEngine::package() const { - return d->package; + return d->package ? *d->package : Package(); } void DataEngine::scheduleSourcesUpdated() @@ -541,11 +541,13 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info) const QString path = KStandardDirs::locate("data", "plasma/dataengines/" + dataEngineDescription.pluginName() + '/'); - PackageStructure::Ptr structure = Plasma::packageStructure(api, Plasma::DataEngineComponent); - structure->setPath(path); - package = new Package(path, structure); + package = new Package(Package::load("Plasma/DataEngine", api)); + package->setPath(path); + + if (package->isValid()) { + script = Plasma::loadScriptEngine(api, q); + } - script = Plasma::loadScriptEngine(api, q); if (!script) { kDebug() << "Could not create a" << api << "ScriptEngine for the" << dataEngineDescription.name() << "DataEngine."; diff --git a/dataengine.h b/dataengine.h index 6623900e0..afe994300 100644 --- a/dataengine.h +++ b/dataengine.h @@ -231,7 +231,7 @@ NoAlignment) const; * * @return the Package object, or 0 if none **/ - const Package *package() const; + Package package() const; /** * @return the plugin name for the applet