debug is actually supposed to be in the global context, along with print; this is how it is in trunk
svn path=/branches/KDE/4.4/kdebase/runtime/; revision=1083638
This commit is contained in:
parent
7f24495652
commit
01852fb8e2
@ -343,11 +343,6 @@ bool AppletInterface::hasExtension(const QString &extension) const
|
|||||||
return m_appletScriptEngine->loadedExtensions().contains(extension.toLower());
|
return m_appletScriptEngine->loadedExtensions().contains(extension.toLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletInterface::debug(const QString &msg)
|
|
||||||
{
|
|
||||||
kDebug() << msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject *AppletInterface::findChild(const QString &name) const
|
QObject *AppletInterface::findChild(const QString &name) const
|
||||||
{
|
{
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
|
@ -241,7 +241,6 @@ enum AnimationDirection {
|
|||||||
Q_INVOKABLE bool include(const QString &script);
|
Q_INVOKABLE bool include(const QString &script);
|
||||||
Q_INVOKABLE bool hasExtension(const QString &extension) const;
|
Q_INVOKABLE bool hasExtension(const QString &extension) const;
|
||||||
|
|
||||||
Q_INVOKABLE void debug(const QString &msg);
|
|
||||||
Q_INVOKABLE QObject *findChild(const QString &name) const;
|
Q_INVOKABLE QObject *findChild(const QString &name) const;
|
||||||
|
|
||||||
Q_INVOKABLE Plasma::Extender *extender() const;
|
Q_INVOKABLE Plasma::Extender *extender() const;
|
||||||
|
@ -569,6 +569,8 @@ void SimpleJavaScriptApplet::setupObjects()
|
|||||||
|
|
||||||
fun = m_engine->newFunction(SimpleJavaScriptApplet::print);
|
fun = m_engine->newFunction(SimpleJavaScriptApplet::print);
|
||||||
global.setProperty("print", fun);
|
global.setProperty("print", fun);
|
||||||
|
fun = m_engine->newFunction(SimpleJavaScriptApplet::debug);
|
||||||
|
global.setProperty("print", debug);
|
||||||
|
|
||||||
// Work around bug in 4.3.0
|
// Work around bug in 4.3.0
|
||||||
qMetaTypeId<QVariant>();
|
qMetaTypeId<QVariant>();
|
||||||
@ -905,6 +907,16 @@ QScriptValue SimpleJavaScriptApplet::print(QScriptContext *context, QScriptEngin
|
|||||||
return engine->undefinedValue();
|
return engine->undefinedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QScriptValue SimpleJavaScriptApplet::debug(QScriptContext *context, QScriptEngine *engine)
|
||||||
|
{
|
||||||
|
if (context->argumentCount() < 1) {
|
||||||
|
return engine->undefinedValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
kDebug() << context->argument(0).toString();
|
||||||
|
return engine->undefinedValue();
|
||||||
|
}
|
||||||
|
|
||||||
void SimpleJavaScriptApplet::collectGarbage()
|
void SimpleJavaScriptApplet::collectGarbage()
|
||||||
{
|
{
|
||||||
m_engine->collectGarbage();
|
m_engine->collectGarbage();
|
||||||
|
@ -97,6 +97,7 @@ private:
|
|||||||
static QScriptValue createWidget(QScriptContext *context, QScriptEngine *engine);
|
static QScriptValue createWidget(QScriptContext *context, QScriptEngine *engine);
|
||||||
static QScriptValue notSupported(QScriptContext *context, QScriptEngine *engine);
|
static QScriptValue notSupported(QScriptContext *context, QScriptEngine *engine);
|
||||||
static QScriptValue print(QScriptContext *context, QScriptEngine *engine);
|
static QScriptValue print(QScriptContext *context, QScriptEngine *engine);
|
||||||
|
static QScriptValue debug(QScriptContext *context, QScriptEngine *engine);
|
||||||
static QScriptValue widgetAdjustSize(QScriptContext *context, QScriptEngine *engine);
|
static QScriptValue widgetAdjustSize(QScriptContext *context, QScriptEngine *engine);
|
||||||
|
|
||||||
// run extension
|
// run extension
|
||||||
|
Loading…
Reference in New Issue
Block a user