[Kde-bindings] Qt4 QtRuby DBus

Peter Rullmann peter at p4n.net
Sun Oct 1 15:32:41 UTC 2006


Hi,

I just started using the DBus bindings in QtRuby (Qt4) and am very
glad they exist, because they seem to be the only up-to-date and
working Ruby DBus Bindings.
But I found the following inconsistencies while using them:

It isn't easy to get the type of a Qt::DBusMessage. Calling the "type"
method seems to call the depricated Object.type method of Ruby. I can
only get the type if I call 'some_dbus_message.method_missing( :type
)'.
I guess the best solution would be to add a "message_type" method to
Qt::DBusMessage, that returns symbols like :reply_message or
:error_message.
A convenient shortcut would be an "error?" method.
I also could not access Qt::DBusMessage::MessageType, but that is not
really needed anyway.

I would like to call a remote method over dbus like this:
  proxy = Qt::DBusInterface.new(SERVICE, OBJECT, INTERFACE)
  proxy.call("Methodname", -1, "Test")
But this will print an error saying that the method "call" is not defined.
Instead I have to write:
  proxy = Qt::DBusInterface.new(SERVICE, OBJECT, INTERFACE)
  proxy.call("Methodname", Qt::Variant.new(-1), Qt::Variant.new("Test"))
Is it possible to allow arguments without having to encapsulate them
in a Qt::Variant?

Convenient would be to call "some_dbus_message.value" instead of
"some_dbus_message.arguments[0].to_string_list" (because the return
value is again a Qt::Variant).
What is interesting is that "some_dbus_message.methods" lists a
"value" method but I cannot call it.

Peter
-- 
Peter Rullmann <peter AT p4n.net>     http://p4n.net     [ICQ: 22931645]
Richard-Wagner-Str. 72, 66111 Saarbruecken, Germany.     +49/681/9388281



More information about the Kde-bindings mailing list