From 64182e27d7124489524e1a9c9dca23ccd0455f32 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 28 Jul 2010 02:08:17 -0700 Subject: [PATCH 1/2] wifi: ensure scanning property is updated on supplicant interface state changes The wifi device is considered to be 'scanning' if the supplicant emits the scanning signal or if it's in the scanning state; but the code didn't correctly handle notifications when the supplicant was in the scanning state. --- src/nm-device-wifi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 895d4d1765..3973fe7bc5 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -2593,6 +2593,11 @@ supplicant_iface_connection_state_cb_handler (gpointer user_data) } out: + /* Signal scanning state changes */ + if ( task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING + || task->old_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING) + g_object_notify (G_OBJECT (self), "scanning"); + finish_supplicant_task (task, FALSE); return FALSE; } From 2ffa6a830e2e8793d8d39294418c0b6dc20ead54 Mon Sep 17 00:00:00 2001 From: Daniel Gnoutcheff Date: Wed, 28 Jul 2010 02:28:45 -0700 Subject: [PATCH 2/2] 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