GNOME Bugzilla – Bug 648027
g_settings_bind_with_mapping: no support for passing multiple callbacks with only one user_data
Last modified: 2016-09-15 07:53:49 UTC
Bindings for the following are broken: void g_settings_bind_with_mapping(GSettings *settings, const gchar *key, gpointer object, const gchar *property, GSettingsBindFlags flags, GSettingsBindGetMapping get_mapping, GSettingsBindSetMapping set_mapping, gpointer user_data, GDestroyNotify destroy); Bindings would need to support get_mapping and set_mapping with only one user_data. Current non-working bindings: Settings.bind_with_mapping (string key, void* object, string property, GLib.SettingsBindFlags flags, GLib.SettingsBindGetMapping get_mapping, GLib.SettingsBindSetMapping set_mapping, GLib.DestroyNotify destroy);
IRC log regarding this issue: <Lethalman> a workaround would be to make BindGetMapping and BindSetMapping have has_target=false <Lethalman> more than a workaround, that's unfortunately the right fix
or could fix this with new API upstream, possibly a GClosure-enabled variant.
Created attachment 186159 [details] [review] Hack to pass the user_data parameter explicitly
Created attachment 186163 [details] [review] gio patch This adds the required API to gio (which we could then bind from vala with some minimal adjustments). I want a sign-off from someone from gobject-introspection first.
So, I looked a bit into the go-i side and I discovered a few things: 1) py-gi and gjs both seem to lack support for functions with multiple callbacks (completely). They say: TypeError: Function Gio.bind_with_mapping_full has multiple callbacks, not supported and Error: Function Gio.bind_with_mapping_full has multiple callbacks, not supported which leads me to believe that the error is coming from a lower level (since it is exactly the same for both of them). I did discover (from asking in #gobject-introspection) that we should probably include a 'Rename to:' attribute on the _full function. I tried that and it had no effect, though.
commit 67200696ee5b4abcb388046270aa1d864f9ea367 Author: Evan Nemerson <evan@coeus-group.com> Date: Tue Jun 26 01:38:31 2012 -0700 gio-2.0: fix Settings.bind_with_mapping This method is skipped in the GIR because of the shared user_data parameter. Vala doesn't support this, either, so to get around it we have to set has_target = false on the delegates and pass the void* manually. This also changes the names of the relevant delegates so there is no collision if/when the issue is resolved in GIO.