[Kde-bindings] KDE/kdelibs/plasma
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Nov 5 20:32:53 UTC 2008
SVN commit 880550 by rdale:
* Add package() and mainScript() methods to the scripting dataengine class
* Fix expected load path for a scripting dataengine and change from
'plasma/engines' to 'plasma/dataengines' to be in line with the
'dataengine' type option of the plasmapkg tool
CCMAIL: kde-bindings at kde.org
M +1 -1 dataengine.cpp
M +13 -0 scripting/dataenginescript.cpp
M +12 -0 scripting/dataenginescript.h
--- trunk/KDE/kdelibs/plasma/dataengine.cpp #880549:880550
@@ -459,7 +459,7 @@
if (!api.isEmpty()) {
const QString path =
KStandardDirs::locate("data",
- "plasma/engines/" + dataEngineDescription.pluginName() + '/');
+ "plasma/dataengines/" + dataEngineDescription.pluginName() + '/');
PackageStructure::Ptr structure =
Plasma::packageStructure(api, Plasma::DataEngineComponent);
structure->setPath(path);
--- trunk/KDE/kdelibs/plasma/scripting/dataenginescript.cpp #880549:880550
@@ -20,6 +20,7 @@
#include "dataenginescript.h"
#include "dataengine.h"
+#include "package.h"
namespace Plasma
{
@@ -73,6 +74,18 @@
return d->dataEngine->serviceForSource(source);
}
+QString DataEngineScript::mainScript() const
+{
+ Q_ASSERT(d->dataEngine);
+ return d->dataEngine->package()->filePath("mainscript");
+}
+
+const Package *DataEngineScript::package() const
+{
+ Q_ASSERT(d->dataEngine);
+ return d->dataEngine->package();
+}
+
void DataEngineScript::setData(const QString &source, const QString &key,
const QVariant &value)
{
--- trunk/KDE/kdelibs/plasma/scripting/dataenginescript.h #880549:880550
@@ -98,6 +98,18 @@
virtual Service *serviceForSource(const QString &source);
protected:
+ /**
+ * @return absolute path to the main script file for this plasmoid
+ */
+ QString mainScript() const;
+
+ /**
+ * @return the Package associated with this plasmoid which can
+ * be used to request resources, such as images and
+ * interface files.
+ */
+ const Package *package() const;
+
void setData(const QString &source, const QString &key,
const QVariant &value);
void setData(const QString &source, const QVariant &value);
More information about the Kde-bindings
mailing list