settings: in _commit_changes_full() mark the connection as saved before emitting signals

_commit_changes_full() calls _replace_settings_full() which already emits signals
about the changed connection. We should mark the connectin as saved earlier.

In fact, we can tell _replace_settings_full() to mark it as not-unsaved
via the persist-mode parameter.

(cherry picked from commit 4fd5e6e1bb)
This commit is contained in:
Thomas Haller 2017-11-30 12:46:18 +01:00
parent 2bac3ea550
commit 75a520af69

View file

@ -711,7 +711,7 @@ _commit_changes_full (NMSettingsConnection *self,
if (!_replace_settings_full (self,
reread_connection ?: new_connection,
!reread_connection,
NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP,
NM_SETTINGS_CONNECTION_PERSIST_MODE_DISK,
new_connection
? "update-during-write"
: "replace-and-commit-disk",
@ -723,9 +723,8 @@ _commit_changes_full (NMSettingsConnection *self,
g_propagate_error (error, g_steal_pointer (&local));
g_return_val_if_reached (FALSE);
}
}
set_unsaved (self, FALSE);
} else
set_unsaved (self, FALSE);
if (reread_connection)
_LOGI ("write: successfully updated (%s), connection was modified in the process", logmsg_change);