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.
This commit is contained in:
Daniel Gnoutcheff 2010-07-28 02:28:45 -07:00 committed by Dan Williams
parent 64182e27d7
commit 2ffa6a830e

View file

@ -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