diff options
author | Dan Winship <danw@gnome.org> | 2014-08-18 14:17:52 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-09-18 11:51:08 -0400 |
commit | b728d1fb706cb686d5a36bd6d3b10ad1289dae8c (patch) | |
tree | 08764cc2d5645ad67cb01e9a455472b7fafc8ed9 /libnm/nm-dhcp4-config.c | |
parent | aa18b88a4f856d6d7abe3a365285a36d297c93ba (diff) | |
download | NetworkManager-b728d1fb706cb686d5a36bd6d3b10ad1289dae8c.tar.gz |
libnm: let NMObject create all D-Bus proxies
Add _nm_object_class_add_interface(), for declaring that a class
implements a particular interface, and then have NMObject create the
corresponding proxies itself. (The subclass can get a copy with
_nm_object_get_proxy() if it needs it for something).
(In GDBus, creating a proxy is a heavier operation than in dbus-glib,
so we'll need to create the proxies asynchronously. Moving the
creation to NMObject makes that easier since we can do it as part
of the existing init/init_async.)
Diffstat (limited to 'libnm/nm-dhcp4-config.c')
-rw-r--r-- | libnm/nm-dhcp4-config.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libnm/nm-dhcp4-config.c b/libnm/nm-dhcp4-config.c index 0782b23736..bbbac64226 100644 --- a/libnm/nm-dhcp4-config.c +++ b/libnm/nm-dhcp4-config.c @@ -31,8 +31,6 @@ G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_OBJECT) #define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigPrivate)) typedef struct { - DBusGProxy *proxy; - GHashTable *options; } NMDhcp4ConfigPrivate; @@ -84,9 +82,8 @@ init_dbus (NMObject *object) NM_OBJECT_CLASS (nm_dhcp4_config_parent_class)->init_dbus (object); - priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DHCP4_CONFIG); _nm_object_register_properties (object, - priv->proxy, + NM_DBUS_INTERFACE_DHCP4_CONFIG, property_info); } @@ -98,8 +95,6 @@ finalize (GObject *object) if (priv->options) g_hash_table_destroy (priv->options); - g_object_unref (priv->proxy); - G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->finalize (object); } @@ -129,6 +124,8 @@ nm_dhcp4_config_class_init (NMDhcp4ConfigClass *config_class) g_type_class_add_private (config_class, sizeof (NMDhcp4ConfigPrivate)); + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DHCP4_CONFIG); + /* virtual methods */ object_class->get_property = get_property; object_class->finalize = finalize; |