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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user