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-remote-settings.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-remote-settings.c')
-rw-r--r-- | libnm/nm-remote-settings.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c index 8c570f2062..371b8f20b4 100644 --- a/libnm/nm-remote-settings.c +++ b/libnm/nm-remote-settings.c @@ -860,11 +860,9 @@ init_dbus (NMObject *object) NM_OBJECT_CLASS (nm_remote_settings_parent_class)->init_dbus (object); - priv->proxy = _nm_object_new_proxy (object, - NM_DBUS_PATH_SETTINGS, - NM_DBUS_INTERFACE_SETTINGS); + priv->proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE_SETTINGS); _nm_object_register_properties (object, - priv->proxy, + NM_DBUS_INTERFACE_SETTINGS, property_info); g_signal_connect (object, "notify::" NM_OBJECT_NM_RUNNING, @@ -919,7 +917,6 @@ dispose (GObject *object) g_clear_pointer (&priv->visible_connections, g_ptr_array_unref); g_clear_pointer (&priv->hostname, g_free); - g_clear_object (&priv->proxy); G_OBJECT_CLASS (nm_remote_settings_parent_class)->dispose (object); } @@ -957,6 +954,8 @@ nm_remote_settings_class_init (NMRemoteSettingsClass *class) g_type_class_add_private (class, sizeof (NMRemoteSettingsPrivate)); + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_SETTINGS); + /* Virtual methods */ object_class->constructor = constructor; object_class->get_property = get_property; |