Net::DBus and qdbus disagreement
Daniel P. Berrange
dan at berrange.com
Sun Dec 18 13:29:42 PST 2011
On Sun, Dec 18, 2011 at 02:57:34PM -0600, Robert Wenner wrote:
> Hi all,
>
> I have a problem opening KMail's composer window from the Net::DBus Perl
> module.
>
> When I run the example that comes with Net::DBus, it only shows me one
> openComposer method which takes 6 arguments:
>
> robert at habanero:~/hrsn/Net-DBus-1.0.0/examples$ perl dump-object.pl
> org.kde.kmail /KMail | grep -A 7 openComposer
> Method: openComposer
> > string (to)
> > string (cc)
> > string (bcc)
> > string (subject)
> > string (body)
> > bool (hidden)
> < objectpath
>
> However, qdbus shows 3 methods, and I want to call the one that takes 9
> arguments.
>
> robert at habanero:~/hrsn/Net-DBus-1.0.0/examples$ qdbus org.kde.kmail /KMail
> | grep openComposer
> method QDBusObjectPath org.kde.kmail.kmail.openComposer(QString to, ...snip...)
> method int org.kde.kmail.kmail.openComposer(QString to, ...snip...)
> method int org.kde.kmail.kmail.openComposer(QString to, ...snip..)
Ok, so this is showing that there are 3 methods exported in the same
interface, all with the same name. I did not realize that this is
allowed by DBus. The Net::DBus code is assuming that method names
are unique within the scope of a single interface, so it is only
able to show you a single method.
> robert at habanero:~/hrsn/Net-DBus-1.0.0/examples$
>
> Consequently, if I try to call the 9 argument version from Perl, it fails:
> robert at habanero:~$ tm-mail.pl
> expected 6 params, but got 9 at
> /usr/local/lib/perl/5.10.1/Net/DBus/Binding/Introspector.pm line 1115,
> <DATA> line 303.
>
> What am I missing here?
> What do I need to do to make Net::DBus see and call the other methods?
I will need to update the Net::DBus code to take account of the fact that
you can have multiple methods with the same name within a single
interface.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20111218/433cb1df/attachment.pgp>
More information about the dbus
mailing list