expose dataEngine() to scripts

svn path=/trunk/KDE/kdelibs/; revision=1051213
This commit is contained in:
Aaron J. Seigo 2009-11-19 00:19:30 +00:00
parent 94da57f819
commit e8a80f6487
2 changed files with 17 additions and 1 deletions

View File

@ -19,8 +19,9 @@
#include "plasma/scripting/runnerscript.h" #include "plasma/scripting/runnerscript.h"
#include "plasma/package.h"
#include "plasma/abstractrunner.h" #include "plasma/abstractrunner.h"
#include "plasma/dataenginemanager.h"
#include "plasma/package.h"
#include "plasma/private/abstractrunner_p.h" #include "plasma/private/abstractrunner_p.h"
namespace Plasma namespace Plasma
@ -66,6 +67,15 @@ void RunnerScript::run(const Plasma::RunnerContext &search, const Plasma::QueryM
Q_UNUSED(action); Q_UNUSED(action);
} }
DataEngine *RunnerScript::dataEngine(const QString &name)
{
if (d->runner) {
return d->runner->dataEngine(name);
}
return DataEngineManager::self()->engine(QString());
}
KConfigGroup RunnerScript::config() const KConfigGroup RunnerScript::config() const
{ {
if (d->runner) { if (d->runner) {

View File

@ -101,6 +101,12 @@ protected:
*/ */
KPluginInfo description() const; KPluginInfo description() const;
/**
* @return a Plasma::DataEngine matchin name
* @since 4.4
*/
DataEngine *dataEngine(const QString &name);
KConfigGroup config() const; KConfigGroup config() const;
void setIgnoredTypes(RunnerContext::Types types); void setIgnoredTypes(RunnerContext::Types types);
void setHasRunOptions(bool hasRunOptions); void setHasRunOptions(bool hasRunOptions);