summaryrefslogtreecommitdiff
path: root/libnm/nm-ip4-config.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-08-18 14:17:52 -0400
committerDan Winship <danw@gnome.org>2014-09-18 11:51:08 -0400
commitb728d1fb706cb686d5a36bd6d3b10ad1289dae8c (patch)
tree08764cc2d5645ad67cb01e9a455472b7fafc8ed9 /libnm/nm-ip4-config.c
parentaa18b88a4f856d6d7abe3a365285a36d297c93ba (diff)
downloadNetworkManager-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-ip4-config.c')
-rw-r--r--libnm/nm-ip4-config.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libnm/nm-ip4-config.c b/libnm/nm-ip4-config.c
index 77937c4699..a6890a4e74 100644
--- a/libnm/nm-ip4-config.c
+++ b/libnm/nm-ip4-config.c
@@ -33,8 +33,6 @@ G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, NM_TYPE_OBJECT)
#define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate))
typedef struct {
- DBusGProxy *proxy;
-
char *gateway;
GSList *addresses;
GSList *routes;
@@ -143,9 +141,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_ip4_config_parent_class)->init_dbus (object);
- priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_IP4_CONFIG);
_nm_object_register_properties (object,
- priv->proxy,
+ NM_DBUS_INTERFACE_IP4_CONFIG,
property_info);
}
@@ -164,8 +161,6 @@ finalize (GObject *object)
g_strfreev (priv->searches);
g_strfreev (priv->wins);
- g_object_unref (priv->proxy);
-
G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object);
}
@@ -218,6 +213,8 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate));
+ _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_IP4_CONFIG);
+
/* virtual methods */
object_class->get_property = get_property;
object_class->finalize = finalize;