mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-19 05:30:38 +02:00
core: allow ActiveConnection connection to be changed
For the case of AddAndActivate, which needs to set the final connection after authentication is done and NMSettings has returned the final connection.
This commit is contained in:
parent
8252357dd1
commit
ae116d847e
2 changed files with 18 additions and 0 deletions
|
|
@ -133,6 +133,21 @@ nm_active_connection_get_connection (NMActiveConnection *self)
|
|||
return NM_ACTIVE_CONNECTION_GET_PRIVATE (self)->connection;
|
||||
}
|
||||
|
||||
void
|
||||
nm_active_connection_set_connection (NMActiveConnection *self,
|
||||
NMConnection *connection)
|
||||
{
|
||||
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
|
||||
|
||||
/* Can't change connection after the ActiveConnection is exported over D-Bus */
|
||||
g_return_if_fail (priv->path == NULL);
|
||||
g_return_if_fail (priv->connection == NULL || !NM_IS_SETTINGS_CONNECTION (priv->connection));
|
||||
|
||||
if (priv->connection)
|
||||
g_object_unref (priv->connection);
|
||||
priv->connection = g_object_ref (connection);
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_active_connection_get_path (NMActiveConnection *self)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ void nm_active_connection_export (NMActiveConnection *self);
|
|||
|
||||
NMConnection *nm_active_connection_get_connection (NMActiveConnection *self);
|
||||
|
||||
void nm_active_connection_set_connection (NMActiveConnection *self,
|
||||
NMConnection *connection);
|
||||
|
||||
const char * nm_active_connection_get_name (NMActiveConnection *self);
|
||||
|
||||
const char * nm_active_connection_get_path (NMActiveConnection *self);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue