GNOME Bugzilla – Bug 710817
Allow access to generated D-Bus proxy object
Last modified: 2018-05-22 14:57:58 UTC
At the moment, if I generate a D-Bus interface and proxy object using the ‘DBus’ attribute on an interface (let’s assume one called org.bluez.Device), the type org.bluez.Device gives me access to the generated GInterface, i.e. orgbluezDevice in C. There is currently no way that I can find to also get easy access to the generated proxy object from Vala, i.e. orgbluezDeviceProxy in C. The only way to do it at the moment is with the following code: delegate Type TypeFunc (); proxy = ((TypeFunc) (typeof (org.bluez.Device).get_qdata (Quark.from_string ("vala-dbus-proxy-type")))) (); which is less than fun. Could some accessor be added please? For example, org.bluez.Device.Proxy. Thanks.
What's your use case for needing the proxy object?
(In reply to comment #1) > What's your use case for needing the proxy object? A DBusProxyTypeFunc for use with DBusObjectManagerClient. See here: http://cgit.collabora.com/git/user/pwith/folks.git/tree/backends/bluez/bluez-backend.vala?h=685848-bluez-SQUASHED#n392
Since vala is generating the proxy object types, it seems like the DBusProxyTypeFunc function should be automatically generated as well since it can be trivially generated since the vala compiler knows about all of the interfaces already. Here is an updated link from the previous comment: http://cgit.collabora.com/git/user/pwith/folks.git/tree/backends/bluez/bluez-backend.vala#n575
The current code is very fine in my opinion. Additionally, I'm ok with autogenerating the callback if null is passed.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/412.