From 50f6b47074e01dffb8dc536c0a20961dcf28ae9b Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 7 Feb 2018 02:39:23 +0100 Subject: New upstream version 1.10.4 --- src/settings/nm-settings-connection.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/settings/nm-settings-connection.c') diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index b6e89404..37a0b3a6 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -517,6 +517,7 @@ set_persist_mode (NMSettingsConnection *self, NMSettingsConnectionPersistMode pe TRUE); return; case NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP: + case NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP_SAVED: /* Nothing to do */ return; } @@ -793,7 +794,7 @@ nm_settings_connection_delete (NMSettingsConnection *self, /* Remove connection from seen-bssids database file */ remove_entry_from_db (self, "seen-bssids"); - nm_settings_connection_signal_remove (self, FALSE); + nm_settings_connection_signal_remove (self); return TRUE; } @@ -2187,15 +2188,24 @@ impl_settings_connection_clear_secrets (NMSettingsConnection *self, /*****************************************************************************/ void -nm_settings_connection_signal_remove (NMSettingsConnection *self, gboolean allow_reuse) +nm_settings_connection_added (NMSettingsConnection *self) { NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); - if (!allow_reuse) { - if (priv->removed) - g_return_if_reached (); - priv->removed = TRUE; - } + /* FIXME: we should always dispose connections that are removed + * and not reuse them, but currently plugins keep alive unmanaged + * (e.g. NM_CONTROLLED=no) connections. */ + priv->removed = FALSE; +} + +void +nm_settings_connection_signal_remove (NMSettingsConnection *self) +{ + NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); + + if (priv->removed) + return; + priv->removed = TRUE; g_signal_emit_by_name (self, NM_SETTINGS_CONNECTION_REMOVED); } -- cgit 1.3.0-6-gf8a5