All method arguments passed to callDBus represented by QScriptValue are simply converted to QVariant with QScriptValue.toVariant(). In case of arrays such call results in array of variants. If service declares method signature explicitly and expects array of strings then call will be rejected by message bus. Perfect solution would probably require checking of both method signature and QScriptValue type and do the proper casting, but for quick solution it is safe to assume we prefer array of strings instead of array of variants. See attachment for fix that works for me. Reproducible: Always Steps to Reproduce: 1. Try to call method which expects array of strings ie callDBus("org.kde.klauncher","/","org.kde.KLauncher","exec_blind","konsole",new Array())
Created attachment 75905 [details] Simple fix for string arrays
could you please open a review request for the patch? I totally missed the patch attached to the report, we only use review board.
I just reviewed the patch - looks good to me, can go in. Do you have a push privileges? If yes, please push to 4.10 branch, if not please upload a patch exported with git format-patch That will keep your ownership.
Git commit 5712da0bb06ecfe86017895cbbb72cd5c5551fcd by Martin Gräßlin. Committed on 17/01/2013 at 09:30. Pushed by graesslin into branch 'KDE/4.10'. Support arrays in callDBus method of KWin Scripting Thanks to Jan Palus for providing the patch. FIXED-IN: 4.10 M +6 -1 kwin/scripting/scripting.cpp http://commits.kde.org/kde-workspace/5712da0bb06ecfe86017895cbbb72cd5c5551fcd