summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-ip6-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-ip6-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-ip6-config.c')
-rw-r--r--libnm-glib/nm-ip6-config.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c
index 7e9bf3cd8a..f62ab82a11 100644
--- a/libnm-glib/nm-ip6-config.c
+++ b/libnm-glib/nm-ip6-config.c
@@ -124,20 +124,20 @@ demarshal_ip6_routes_array (NMObject *object, GParamSpec *pspec, GValue *value,
}
static void
-register_for_property_changed (NMIP6Config *config)
+register_properties (NMIP6Config *config)
{
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
- const NMPropertiesChangedInfo property_changed_info[] = {
- { NM_IP6_CONFIG_ADDRESSES, demarshal_ip6_address_array, &priv->addresses },
- { NM_IP6_CONFIG_NAMESERVERS, demarshal_ip6_nameserver_array, &priv->nameservers },
- { NM_IP6_CONFIG_DOMAINS, demarshal_domains, &priv->domains },
- { NM_IP6_CONFIG_ROUTES, demarshal_ip6_routes_array, &priv->routes },
+ const NMPropertiesInfo property_info[] = {
+ { NM_IP6_CONFIG_ADDRESSES, &priv->addresses, demarshal_ip6_address_array },
+ { NM_IP6_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip6_nameserver_array },
+ { NM_IP6_CONFIG_DOMAINS, &priv->domains, demarshal_domains },
+ { NM_IP6_CONFIG_ROUTES, &priv->routes, demarshal_ip6_routes_array },
{ 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);
}
/**
@@ -309,7 +309,7 @@ constructor (GType type,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_IP6_CONFIG);
- register_for_property_changed (NM_IP6_CONFIG (object));
+ register_properties (NM_IP6_CONFIG (object));
return object;
}