nm_connection_replace_settings_from_connection() would return whether the
connection verifies at the end of the operation. While that is not very
useful, the API is like that and cannot be changed.
For consistency, also perform the verification step in case of self-assignment.
Self-assigment is anyway a case that probably never happens.
NMConnectionPrivate *priv;
GHashTableIter iter;
NMSetting *setting;
NMConnectionPrivate *priv;
GHashTableIter iter;
NMSetting *setting;
- gboolean changed, valid;
+ gboolean changed = FALSE;
+ gboolean valid;
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (new_connection), FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (new_connection), FALSE);
/* When 'connection' and 'new_connection' are the same object simply return
* in order not to destroy 'connection' */
if (connection == new_connection)
/* When 'connection' and 'new_connection' are the same object simply return
* in order not to destroy 'connection' */
if (connection == new_connection)
/* No need to validate permissions like nm_connection_replace_settings()
* since we're dealing with an NMConnection which has already done that.
/* No need to validate permissions like nm_connection_replace_settings()
* since we're dealing with an NMConnection which has already done that.
valid = nm_connection_verify (connection, error);
if (changed)
g_signal_emit (connection, signals[CHANGED], 0);
valid = nm_connection_verify (connection, error);
if (changed)
g_signal_emit (connection, signals[CHANGED], 0);