offer access to the plugin information

svn path=/trunk/KDE/kdelibs/; revision=1047326
This commit is contained in:
Aaron J. Seigo 2009-11-11 00:25:54 +00:00
parent b9ea759162
commit 22f9eb317b
6 changed files with 37 additions and 0 deletions

View File

@ -199,6 +199,12 @@ const Package *AppletScript::package() const
return d->applet->package();
}
KPluginInfo AppletScript::description() const
{
Q_ASSERT(d->applet);
return d->applet->d->appletDescription;
}
Extender *AppletScript::extender() const
{
Q_ASSERT(d->applet);

View File

@ -25,6 +25,7 @@
#include <QtCore/QSizeF>
#include <kgenericfactory.h>
#include <kplugininfo.h>
#include <plasma/plasma_export.h>
#include <plasma/scripting/scriptengine.h>
@ -178,6 +179,11 @@ protected:
*/
const Package *package() const;
/**
* @return the KPluginInfo associated with this plasmoid
*/
KPluginInfo description() const;
/**
* @return a standard Plasma applet configuration dialog, ready
* to have pages added to it.

View File

@ -20,6 +20,7 @@
#include "dataenginescript.h"
#include "package.h"
#include "private/dataengine_p.h"
namespace Plasma
{
@ -85,6 +86,12 @@ const Package *DataEngineScript::package() const
return d->dataEngine->package();
}
KPluginInfo DataEngineScript::description() const
{
Q_ASSERT(d->dataEngine);
return d->dataEngine->d->dataEngineDescription;
}
void DataEngineScript::setData(const QString &source, const QString &key,
const QVariant &value)
{

View File

@ -21,6 +21,7 @@
#define PLASMA_DATAENGINESCRIPT_H
#include <kgenericfactory.h>
#include <kplugininfo.h>
#include <plasma/plasma_export.h>
#include <plasma/dataengine.h>
@ -110,6 +111,11 @@ protected:
*/
const Package *package() const;
/**
* @return the KPluginInfo associated with this plasmoid
*/
KPluginInfo description() const;
void setData(const QString &source, const QString &key,
const QVariant &value);
void setData(const QString &source, const QVariant &value);

View File

@ -21,6 +21,7 @@
#include "plasma/package.h"
#include "plasma/abstractrunner.h"
#include "plasma/private/abstractrunner_p.h"
namespace Plasma
{
@ -174,6 +175,11 @@ const Package *RunnerScript::package() const
return d->runner ? d->runner->package() : 0;
}
KPluginInfo RunnerScript::description() const
{
return d->runner ? d->runner->d->runnerDescription : KPluginInfo();
}
QString RunnerScript::mainScript() const
{
if (!package()) {

View File

@ -21,6 +21,7 @@
#define PLASMA_RUNNERSCRIPT_H
#include <kgenericfactory.h>
#include <kplugininfo.h>
#include <plasma/plasma_export.h>
#include <plasma/abstractrunner.h>
@ -95,6 +96,11 @@ protected:
*/
const Package *package() const;
/**
* @return the KPluginInfo associated with this plasmoid
*/
KPluginInfo description() const;
KConfigGroup config() const;
void setIgnoredTypes(RunnerContext::Types types);
void setHasRunOptions(bool hasRunOptions);