From ae116d847ea8dd03549158a35871e7a1c4796c14 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 28 Aug 2013 11:43:50 -0500 Subject: 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. --- src/nm-active-connection.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nm-active-connection.c') 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) { -- cgit v1.2.1