From debb71285f248d7492f8480fb1dfcdff344aaf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 17 Jan 2013 09:30:09 +0100 Subject: [PATCH] Support arrays in callDBus method of KWin Scripting Thanks to Jan Palus for providing the patch. BUG: 311896 FIXED-IN: 4.10 --- scripting/scripting.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index b4fe2c4fe0..6c6e258656 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -182,7 +182,12 @@ QScriptValue kwinCallDBus(QScriptContext *context, QScriptEngine *engine) QDBusMessage msg = QDBusMessage::createMethodCall(service, path, interface, method); QVariantList arguments; for (int i=4; iargument(i).toVariant(); + if (context->argument(i).isArray()) { + QStringList stringArray = engine->fromScriptValue(context->argument(i)); + arguments << qVariantFromValue(stringArray); + } else { + arguments << context->argument(i).toVariant(); + } } if (!arguments.isEmpty()) { msg.setArguments(arguments);