aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-01-17 08:30:09 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2013-01-17 08:30:09 (GMT)
commit5712da0bb06ecfe86017895cbbb72cd5c5551fcd (patch)
treef9511e7039feb4d8fd9eb780e5a24b43386e2df2
parentb18288c68c1f0edd21573d6b9edcf9289e96f431 (diff)
Support arrays in callDBus method of KWin Scripting
Thanks to Jan Palus for providing the patch. BUG: 311896 FIXED-IN: 4.10
-rw-r--r--kwin/scripting/scripting.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kwin/scripting/scripting.cpp b/kwin/scripting/scripting.cpp
index b4fe2c4..6c6e258 100644
--- a/kwin/scripting/scripting.cpp
+++ b/kwin/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; 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);