GNOME Bugzilla – Bug 581801
Add GIR/typelib for libnm-util.
Last modified: 2015-02-07 17:00:13 UTC
This patch is against the gir-repository module. It builds a GIR typelib for libnm-util. We fix some transfer modes and add helpers for nm_setting_vpn_add_secret(), nm_setting_enumerate_values, and nm_setting_enumerate_values (so that they take a GClosure). We also ensure that register_default_settings() is called, even though bindings might not call the nm_connection_new() constructor.
Created attachment 134228 [details] [review] 0001-Add-GIR-typelib-for-libnm-util.patch
Comment on attachment 134228 [details] [review] 0001-Add-GIR-typelib-for-libnm-util.patch This looks quite good to me, but I am not a dbus expert.
This doesn't build on my system: ./NMUtil-custom.c: In function ‘nm_setting_vpn_add_secret’: ./NMUtil-custom.c:58: error: ‘NMSettingVPN’ has no member named ‘secrets’ ./NMUtil-custom.c: In function ‘nm_setting_enumerate_values_with_closure’: ./NMUtil-custom.c:103: warning: passing argument 2 of ‘nm_setting_enumerate_values’ from incompatible pointer type ./NMUtil-custom.c: In function ‘nm_connection_for_each_setting_value_with_closure’: ./NMUtil-custom.c:115: warning: passing argument 2 of ‘nm_connection_for_each_setting_value’ from incompatible pointer type I have network-manager 0.7.1 NMSettingVPN is defined as typedef struct { ↦ NMSetting parent; } NMSettingVPN; typedef struct { ↦ NMSettingClass parent; } NMSettingVPNClass;
Johan: Oh, huh -- http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/libnm-util/nm-setting-vpn.h#n87 shows that NM upstream has added exactly the nm_setting_vpn_add_secret method I was adding here. I'll attach a patch without this function, since you'll get it for free with NM 0.7.1.
Created attachment 135026 [details] [review] Add-GIR-typelib-for-libnm-util.patch
Comment on attachment 135026 [details] [review] Add-GIR-typelib-for-libnm-util.patch Looks good, assuming it builds for Johan
(In reply to comment #6) > (From update of attachment 135026 [details] [review] [edit]) > Looks good, assuming it builds for Johan > Yes builds fine, after applying bug# 581685 to g-i
The annotations on nm_connection_new_from_hash and nm_connection_replace_settings and nm_connection_to_hash depend on bug 581685 (parameterized type support in annotations); otherwise you get: ERROR:girnode.c:1409:g_ir_node_build_typelib: assertion failed: (node != NULL) when g-object-introspection fails to parse the element-type annotation.
OK, bug 581685 has been landed, so this patch should be good to go, I guess.
We will not add gir/typelib generation for more libraries to gir-repository, instead they should go into the upstream package instead.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]