GNOME Bugzilla – Bug 690684
DBus VTable delegates require _target
Last modified: 2018-05-22 14:38:37 UTC
Created attachment 232161 [details] [review] 'has_target = false' and add a user_data void pointer to VTable delegates Using DBus VTable delegates will cause cause compile errors like error: ‘GDBusSubtreeVTable’ has no member named ‘dispatch_target’ for DBusSubtreeDispatchFunc. The attached patch will add CCode 'has_target = false' and add a user_data void pointer for user data transfer to the following delegates: DBusSubtreeEnumerateFunc DBusSubtreeIntrospectFunc DBusSubtreeDispatchFunc DBusInterfaceMethodCallFunc DBusInterfaceGetPropertyFunc DBusInterfaceSetPropertyFunc nemequ assured me that no other part of vala depends on the current signatures of those delegates.
Created attachment 242783 [details] [review] Removed .vapi part from previous patch as it is generated
Thanks for your patch. It's correct that the delegate itself has a target, but it doesn't have the target in the struct. What about putting CCode (delegate_target = false) on top of the struct fields, like for GLib.MarkupParser? I'd probably like more your approach because it allows retrieving the user_data though. Also please provide the changed .vapi in the patch.
To be honest with you, I don't even understand what 'target' means. I was discussing on irc #vala how to achieve it that I can use user_data (like I would using C) and I was asked to put my findings into a bug. I had a look at MarkupParser but as you rightly noted: It doesn't give me user_data. I had the .vapi in the obsoleted patch, however, the changes in the metadata lead to so many other changes on my system that I thought it counter-intuitive to incluse the .vapi changes. But if you want me to make the obsoleted patch the valid one: no problem.
The target is the user_data. Vala smartly uses it to automatically manage user_data for you, so we have to decide whether to let vala do automatically what it can or not. In this situation, we probably want user_data to be accessible manually. Ok don't include the .vapi, your system .gir is out of date maybe.
-- 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/344.