Support arrays in callDBus method of KWin Scripting

Thanks to Jan Palus for providing the patch.

BUG: 311896
FIXED-IN: 4.10
This commit is contained in:
Martin Gräßlin 2013-01-17 09:30:09 +01:00
parent 3cddfdecff
commit debb71285f

View file

@ -182,7 +182,12 @@ QScriptValue kwinCallDBus(QScriptContext *context, QScriptEngine *engine)
QDBusMessage msg = QDBusMessage::createMethodCall(service, path, interface, method);
QVariantList arguments;
for (int i=4; i<argumentsCount; ++i) {
arguments << context->argument(i).toVariant();
if (context->argument(i).isArray()) {
QStringList stringArray = engine->fromScriptValue<QStringList>(context->argument(i));
arguments << qVariantFromValue(stringArray);
} else {
arguments << context->argument(i).toVariant();
}
}
if (!arguments.isEmpty()) {
msg.setArguments(arguments);