include()
svn path=/trunk/KDE/kdebase/runtime/; revision=1144460
This commit is contained in:
parent
e36fc57156
commit
0e4d7f18f4
@ -21,6 +21,7 @@
|
||||
#include <QFile>
|
||||
|
||||
#include <Plasma/AbstractRunner>
|
||||
#include <Plasma/Package>
|
||||
#include <Plasma/QueryMatch>
|
||||
|
||||
#include "authorization.h"
|
||||
@ -145,4 +146,14 @@ void JavaScriptRunner::reportError(ScriptEnv *env, bool fatal)
|
||||
kDebug() << env->engine()->uncaughtExceptionBacktrace();
|
||||
}
|
||||
|
||||
bool JavaScriptRunner::include(const QString &script)
|
||||
{
|
||||
const QString path = package()->filePath("scripts", script);
|
||||
if (path.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return m_env->include(path);
|
||||
}
|
||||
|
||||
#include "javascriptrunner.moc"
|
||||
|
@ -48,6 +48,9 @@ public:
|
||||
/** Reimplemented to forward to script. */
|
||||
void exec(const Plasma::RunnerContext *search, const Plasma::QueryMatch *action);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool include(const QString &script);
|
||||
|
||||
protected:
|
||||
void setupObjects();
|
||||
void importExtensions();
|
||||
|
Loading…
x
Reference in New Issue
Block a user