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-ethernet.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-ethernet.c')
-rw-r--r-- | libnm-glib/nm-device-ethernet.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c index 912ba6a122..1eb81890cb 100644 --- a/libnm-glib/nm-device-ethernet.c +++ b/libnm-glib/nm-device-ethernet.c @@ -247,20 +247,20 @@ nm_device_ethernet_init (NMDeviceEthernet *device) } static void -register_for_property_changed (NMDeviceEthernet *device) +register_properties (NMDeviceEthernet *device) { NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); - const NMPropertiesChangedInfo property_changed_info[] = { - { NM_DEVICE_ETHERNET_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, - { NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->perm_hw_address }, - { NM_DEVICE_ETHERNET_SPEED, _nm_object_demarshal_generic, &priv->speed }, - { NM_DEVICE_ETHERNET_CARRIER, _nm_object_demarshal_generic, &priv->carrier }, + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_ETHERNET_HW_ADDRESS, &priv->hw_address }, + { NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, &priv->perm_hw_address }, + { NM_DEVICE_ETHERNET_SPEED, &priv->speed }, + { NM_DEVICE_ETHERNET_CARRIER, &priv->carrier }, { 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* @@ -284,7 +284,7 @@ constructor (GType type, nm_object_get_path (NM_OBJECT (object)), NM_DBUS_INTERFACE_DEVICE_WIRED); - register_for_property_changed (NM_DEVICE_ETHERNET (object)); + register_properties (NM_DEVICE_ETHERNET (object)); return object; } |