diff --git a/scriptengines/javascript/simplejavascriptapplet.cpp b/scriptengines/javascript/simplejavascriptapplet.cpp index 8555e21ca..d2b30ee34 100644 --- a/scriptengines/javascript/simplejavascriptapplet.cpp +++ b/scriptengines/javascript/simplejavascriptapplet.cpp @@ -176,7 +176,7 @@ KSharedPtr SimpleJavaScriptApplet::s_widgetLoader; SimpleJavaScriptApplet::SimpleJavaScriptApplet(QObject *parent, const QVariantList &args) : Plasma::AppletScript(parent) { - //kDebug() << "Script applet launched, args" << args; +// kDebug() << "Script applet launched, args" << applet()->startupArguments(); m_engine = new QScriptEngine(this); importExtensions(); @@ -382,6 +382,14 @@ void SimpleJavaScriptApplet::setupObjects() m_self.setScope(global); global.setProperty("plasmoid", m_self); + QScriptValue args = m_engine->newArray(); + int i = 0; + foreach (QVariant arg, applet()->startupArguments()) { + args.setProperty(i, variant2ScriptValue(m_engine, arg)); + ++i; + } + global.setProperty("startupArguments", args); + //manually create enum values. ugh QMetaObject meta = AppletInterface::staticMetaObject; for (int i=0; i < meta.enumeratorCount(); ++i) {