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-device-bond.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-device-bond.c')
-rw-r--r-- | libnm/nm-device-bond.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c index e378c9cc31..b22d8b30fb 100644 --- a/libnm/nm-device-bond.c +++ b/libnm/nm-device-bond.c @@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE) #define NM_DEVICE_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BOND, NMDeviceBondPrivate)) typedef struct { - DBusGProxy *proxy; - char *hw_address; gboolean carrier; GPtrArray *slaves; @@ -191,9 +189,8 @@ init_dbus (NMObject *object) NM_OBJECT_CLASS (nm_device_bond_parent_class)->init_dbus (object); - priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_BOND); _nm_object_register_properties (object, - priv->proxy, + NM_DBUS_INTERFACE_DEVICE_BOND, property_info); } @@ -202,8 +199,6 @@ dispose (GObject *object) { NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object); - g_clear_object (&priv->proxy); - g_clear_pointer (&priv->slaves, g_ptr_array_unref); G_OBJECT_CLASS (nm_device_bond_parent_class)->dispose (object); @@ -252,6 +247,8 @@ nm_device_bond_class_init (NMDeviceBondClass *bond_class) g_type_class_add_private (bond_class, sizeof (NMDeviceBondPrivate)); + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_BOND); + /* virtual methods */ object_class->dispose = dispose; object_class->finalize = finalize; |