diff options
author | Dan Winship <danw@gnome.org> | 2012-01-20 07:52:17 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-02-03 10:33:43 -0600 |
commit | 2e48cc092c133ed3e10efcc00cf36b29c9d3efc8 (patch) | |
tree | 4cc6f765d30b63a9eff0d171bc6083c114b906f0 /libnm-glib/nm-device-wifi.c | |
parent | 38382770aa36b2690fbb366a649f91e38f449e7c (diff) | |
download | NetworkManager-2e48cc092c133ed3e10efcc00cf36b29c9d3efc8.tar.gz |
libnm-glib: simplify and genericize property declaration
Rename _nm_object_handle_properties_changed(), etc, to be about
properties in general, rather than just property changes.
Interpret func==NULL in NMPropertiesInfo as meaning "use
_nm_object_demarshal_generic", and then reorder the fields so that you
can just leave that field out in the declarations when it's NULL.
Add a way to register properties that exist in D-Bus but aren't
tracked by the NMObjects, and use that for NMDevice's D-Bus Ip4Address
property, replacing the existing hack.
Also add a few other missing properties noticed along the way.
Diffstat (limited to 'libnm-glib/nm-device-wifi.c')
-rw-r--r-- | libnm-glib/nm-device-wifi.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index 9b87a5200a..6ac9181d62 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -667,22 +667,22 @@ demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointe } static void -register_for_property_changed (NMDeviceWifi *device) +register_properties (NMDeviceWifi *device) { NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); - const NMPropertiesChangedInfo property_changed_info[] = { - { NM_DEVICE_WIFI_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, - { NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->perm_hw_address }, - { NM_DEVICE_WIFI_MODE, _nm_object_demarshal_generic, &priv->mode }, - { NM_DEVICE_WIFI_BITRATE, _nm_object_demarshal_generic, &priv->rate }, - { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap }, - { NM_DEVICE_WIFI_CAPABILITIES, _nm_object_demarshal_generic, &priv->wireless_caps }, + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_WIFI_HW_ADDRESS, &priv->hw_address }, + { NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, &priv->perm_hw_address }, + { NM_DEVICE_WIFI_MODE, &priv->mode }, + { NM_DEVICE_WIFI_BITRATE, &priv->rate }, + { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, &priv->active_ap, demarshal_active_ap }, + { NM_DEVICE_WIFI_CAPABILITIES, &priv->wireless_caps }, { NULL }, }; - _nm_object_handle_properties_changed (NM_OBJECT (device), - priv->proxy, - property_changed_info); + _nm_object_register_properties (NM_OBJECT (device), + priv->proxy, + property_info); } static GObject* @@ -720,7 +720,7 @@ constructor (GType type, G_CALLBACK (access_point_removed_proxy), object, NULL); - register_for_property_changed (NM_DEVICE_WIFI (object)); + register_properties (NM_DEVICE_WIFI (object)); g_signal_connect (NM_DEVICE (object), "notify::" NM_DEVICE_STATE, |