summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-dhcp4-config.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-01-20 07:52:17 -0500
committerDan Williams <dcbw@redhat.com>2012-02-03 10:33:43 -0600
commit2e48cc092c133ed3e10efcc00cf36b29c9d3efc8 (patch)
tree4cc6f765d30b63a9eff0d171bc6083c114b906f0 /libnm-glib/nm-dhcp4-config.c
parent38382770aa36b2690fbb366a649f91e38f449e7c (diff)
downloadNetworkManager-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-dhcp4-config.c')
-rw-r--r--libnm-glib/nm-dhcp4-config.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c
index 8299de0294..e3fe2c6cc4 100644
--- a/libnm-glib/nm-dhcp4-config.c
+++ b/libnm-glib/nm-dhcp4-config.c
@@ -77,17 +77,17 @@ demarshal_dhcp4_options (NMObject *object, GParamSpec *pspec, GValue *value, gpo
}
static void
-register_for_property_changed (NMDHCP4Config *config)
+register_properties (NMDHCP4Config *config)
{
NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (config);
- const NMPropertiesChangedInfo property_changed_info[] = {
- { NM_DHCP4_CONFIG_OPTIONS, demarshal_dhcp4_options, &priv->options },
+ const NMPropertiesInfo property_info[] = {
+ { NM_DHCP4_CONFIG_OPTIONS, &priv->options, demarshal_dhcp4_options },
{ NULL },
};
- _nm_object_handle_properties_changed (NM_OBJECT (config),
- priv->proxy,
- property_changed_info);
+ _nm_object_register_properties (NM_OBJECT (config),
+ priv->proxy,
+ property_info);
}
static GObject*
@@ -115,7 +115,7 @@ constructor (GType type,
nm_object_get_path (object),
NM_DBUS_INTERFACE_DHCP4_CONFIG);
- register_for_property_changed (NM_DHCP4_CONFIG (object));
+ register_properties (NM_DHCP4_CONFIG (object));
return G_OBJECT (object);
}