THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#712 - dbus: add ARRAY as possible return value
User who did this - Uli Schlachter (psychon)
----------
You are right. Additionally your table access was a little... off.
With this change, my patch to naughty from above (with "a" changed to "as")
works fine.
(I push the table again to avoid stuff like ((idx < 0) ? idx + 1 : idx) and I
use lua_rawgeti() instead of lua_rawget() because... well, it works that way ;) )
Feel free to amend your patches from above with this change and commit it to
awesome.
Thanks for implementing this so quickly.
@@ -282,14 +282,17 @@ a_dbus_convert_value(lua_State *L, int idx,
DBusMessageIter *iter)
luaL_error(globalconf.L,
"your D-Bus signal handling method returned wrong number
of arguments");
- for(int i = 1; i <= arraylen; i++)
+ lua_pushvalue(L, idx + 1);
+ for(int i = 1; i < arraylen; i += 2)
{
- lua_rawget(L, i);
- lua_rawget(L, i + 1);
- if(!a_dbus_convert_value(L, i, &subiter))
+ lua_rawgeti(L, -1, i);
+ lua_rawgeti(L, -2, i + 1);
+
+ if(!a_dbus_convert_value(L, -2, &subiter))
return false;
lua_pop(L, 2);
}
+ lua_pop(L, 1);
dbus_message_iter_close_container(iter, &subiter);
}
----------
More information can be found at the following URL:
http://awesome.naquadah.org/bugs/index.php?do=details&task_id=712#comment1679
You are receiving this message because you have requested it from the Flyspray
bugtracking system. If you did not expect this message or don't want to
receive mails in future, you can change your notification settings at the URL
shown above.
--
To unsubscribe, send mail to [email protected].