From 2ffa6a830e2e8793d8d39294418c0b6dc20ead54 Mon Sep 17 00:00:00 2001 From: Daniel Gnoutcheff Date: Wed, 28 Jul 2010 02:28:45 -0700 Subject: [PATCH] keyfile: correctly send the 'update' signal For exported connections, nm_settings_connection_interface_update() is supposed to cause the emission of a NM_SETTINGS_CONNECTION_INTERFACE_UPDATED signal. This is usually done by chaining up to the NMExportedConnection implementation of this method, which actually emits the signal. However, the NMKeyfileConnection implementation usually forgot to do this. Rewrite so that we always chain up after successfully saving settings. --- .../plugins/keyfile/nm-keyfile-connection.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index ed56d69d2e..1c90961bef 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -78,22 +78,21 @@ update (NMSettingsConnectionInterface *connection, NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); char *filename = NULL; GError *error = NULL; - gboolean success; - success = write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &filename, &error); - if (success && filename && strcmp (priv->filename, filename)) { + if (!write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &filename, &error)) { + callback (connection, error, user_data); + g_clear_error (&error); + return FALSE; + } + + if (g_strcmp0 (priv->filename, filename)) { /* Update the filename if it changed */ g_free (priv->filename); priv->filename = filename; - success = parent_settings_connection_iface->update (connection, callback, user_data); - } else { - callback (connection, error, user_data); - if (error) - g_error_free (error); + } else g_free (filename); - } - return success; + return parent_settings_connection_iface->update (connection, callback, user_data); } static gboolean