core: use wrappers for DBus object registration/unregistration

When providing a service on the bus daemon and a private connection,
we'll need to track objects so we can register them with the
private connection too.  Thus all registration/unregistration
calls have to go through the NMDBusManager, not straight to
dbus-glib.
This commit is contained in:
Dan Williams
2012-10-04 16:42:03 -05:00
parent 1fec50cc1e
commit 3c7f267fb9
12 changed files with 73 additions and 48 deletions

View File

@@ -102,7 +102,6 @@ nm_ip4_config_export (NMIP4Config *config)
{
NMIP4ConfigPrivate *priv;
NMDBusManager *dbus_mgr;
DBusGConnection *connection;
static guint32 counter = 0;
g_return_if_fail (NM_IS_IP4_CONFIG (config));
@@ -111,10 +110,8 @@ nm_ip4_config_export (NMIP4Config *config)
g_return_if_fail (priv->path == NULL);
dbus_mgr = nm_dbus_manager_get ();
connection = nm_dbus_manager_get_connection (dbus_mgr);
priv->path = g_strdup_printf (NM_DBUS_PATH "/IP4Config/%d", counter++);
dbus_g_connection_register_g_object (connection, priv->path, G_OBJECT (config));
nm_dbus_manager_register_object (dbus_mgr, priv->path, config);
g_object_unref (dbus_mgr);
}