core: export new active connection from the manager
When we eventually do authorization in the ActiveConnection itself, we want to make sure the AC doesn't get exported until everything is authorized. Thus let the manager handle exporting the objects since it knows when the AC will be authorized or not.
This commit is contained in:
@@ -412,7 +412,6 @@ constructed (GObject *object)
|
||||
"notify::" NM_DEVICE_STATE,
|
||||
G_CALLBACK (device_state_changed),
|
||||
NM_ACT_REQUEST (object));
|
||||
nm_active_connection_export (NM_ACTIVE_CONNECTION (object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -3092,8 +3092,10 @@ nm_manager_activate_connection (NMManager *manager,
|
||||
error);
|
||||
|
||||
activated:
|
||||
if (ac)
|
||||
if (ac) {
|
||||
active_connection_add (manager, ac);
|
||||
nm_active_connection_export (ac);
|
||||
}
|
||||
|
||||
return ac;
|
||||
}
|
||||
|
@@ -403,12 +403,10 @@ nm_vpn_connection_new (NMConnection *connection,
|
||||
gboolean user_requested,
|
||||
gulong user_uid)
|
||||
{
|
||||
NMVPNConnection *self;
|
||||
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
|
||||
g_return_val_if_fail (NM_IS_DEVICE (parent_device), NULL);
|
||||
|
||||
self = (NMVPNConnection *) g_object_new (NM_TYPE_VPN_CONNECTION,
|
||||
return (NMVPNConnection *) g_object_new (NM_TYPE_VPN_CONNECTION,
|
||||
NM_ACTIVE_CONNECTION_INT_CONNECTION, connection,
|
||||
NM_ACTIVE_CONNECTION_INT_DEVICE, parent_device,
|
||||
NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, specific_object,
|
||||
@@ -416,10 +414,6 @@ nm_vpn_connection_new (NMConnection *connection,
|
||||
NM_ACTIVE_CONNECTION_INT_USER_UID, user_uid,
|
||||
NM_ACTIVE_CONNECTION_VPN, TRUE,
|
||||
NULL);
|
||||
if (self)
|
||||
nm_active_connection_export (NM_ACTIVE_CONNECTION (self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
Reference in New Issue
Block a user