diff options
author | Dan Williams <dcbw@redhat.com> | 2013-08-28 11:43:50 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2013-10-31 14:15:08 -0500 |
commit | ae116d847ea8dd03549158a35871e7a1c4796c14 (patch) | |
tree | a5b710449048965bd3b21d8bf3371e4b686e0a7d /src | |
parent | 8252357dd1796dd6123a56a10356d0c5496e885b (diff) | |
download | NetworkManager-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')
-rw-r--r-- | src/nm-active-connection.c | 15 | ||||
-rw-r--r-- | src/nm-active-connection.h | 3 |
2 files changed, 18 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) { diff --git a/src/nm-active-connection.h b/src/nm-active-connection.h index 1605c3963a..a86e171a55 100644 --- a/src/nm-active-connection.h +++ b/src/nm-active-connection.h @@ -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); |