summaryrefslogtreecommitdiff
path: root/src/nm-active-connection.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-08-28 11:43:50 -0500
committerDan Williams <dcbw@redhat.com>2013-10-31 14:15:08 -0500
commitae116d847ea8dd03549158a35871e7a1c4796c14 (patch)
treea5b710449048965bd3b21d8bf3371e4b686e0a7d /src/nm-active-connection.c
parent8252357dd1796dd6123a56a10356d0c5496e885b (diff)
downloadNetworkManager-ae116d847ea8dd03549158a35871e7a1c4796c14.tar.gz
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.
Diffstat (limited to 'src/nm-active-connection.c')
-rw-r--r--src/nm-active-connection.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index f811dee82f..2eb88fb35c 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -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)
{