* 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@kde.org svn path=/trunk/KDE/kdelibs/; revision=880550
This commit is contained in:
parent
3eec0b49ad
commit
ecad3fb271
@ -459,7 +459,7 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, KService::Ptr service)
|
|||||||
if (!api.isEmpty()) {
|
if (!api.isEmpty()) {
|
||||||
const QString path =
|
const QString path =
|
||||||
KStandardDirs::locate("data",
|
KStandardDirs::locate("data",
|
||||||
"plasma/engines/" + dataEngineDescription.pluginName() + '/');
|
"plasma/dataengines/" + dataEngineDescription.pluginName() + '/');
|
||||||
PackageStructure::Ptr structure =
|
PackageStructure::Ptr structure =
|
||||||
Plasma::packageStructure(api, Plasma::DataEngineComponent);
|
Plasma::packageStructure(api, Plasma::DataEngineComponent);
|
||||||
structure->setPath(path);
|
structure->setPath(path);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "dataenginescript.h"
|
#include "dataenginescript.h"
|
||||||
|
|
||||||
#include "dataengine.h"
|
#include "dataengine.h"
|
||||||
|
#include "package.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -73,6 +74,18 @@ Service *DataEngineScript::serviceForSource(const QString &source)
|
|||||||
return d->dataEngine->serviceForSource(source);
|
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,
|
void DataEngineScript::setData(const QString &source, const QString &key,
|
||||||
const QVariant &value)
|
const QVariant &value)
|
||||||
{
|
{
|
||||||
|
@ -98,6 +98,18 @@ public:
|
|||||||
virtual Service *serviceForSource(const QString &source);
|
virtual Service *serviceForSource(const QString &source);
|
||||||
|
|
||||||
protected:
|
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,
|
void setData(const QString &source, const QString &key,
|
||||||
const QVariant &value);
|
const QVariant &value);
|
||||||
void setData(const QString &source, const QVariant &value);
|
void setData(const QString &source, const QVariant &value);
|
||||||
|
Loading…
Reference in New Issue
Block a user