mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 16:40:16 +01:00
cli: freeze/thaw property changed signals in nmc_setting_set_property()
Setting one property might affect multiple properties. For example, setting a team property might also emit property changed signal for "team.config". Or, one property might be modified multiple times. For example list properties may first clear the property, then append multiple elements. Or a list property might remove multiple elements. Combine these signals via g_object_freeze_notify() and g_object_thaw_notify().
This commit is contained in:
parent
d3343b241f
commit
7dcf368cf0
1 changed files with 11 additions and 7 deletions
|
|
@ -538,6 +538,7 @@ nmc_setting_set_property (NMClient *client,
|
|||
{
|
||||
const NMMetaPropertyInfo *property_info;
|
||||
gs_free char *value_to_free = NULL;
|
||||
gboolean success;
|
||||
|
||||
g_return_val_if_fail (NM_IS_SETTING (setting), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
|
@ -572,13 +573,16 @@ nmc_setting_set_property (NMClient *client,
|
|||
}
|
||||
}
|
||||
|
||||
return property_info->property_type->set_fcn (property_info,
|
||||
nmc_meta_environment,
|
||||
nmc_meta_environment_arg,
|
||||
setting,
|
||||
modifier,
|
||||
value,
|
||||
error);
|
||||
g_object_freeze_notify (G_OBJECT (setting));
|
||||
success = property_info->property_type->set_fcn (property_info,
|
||||
nmc_meta_environment,
|
||||
nmc_meta_environment_arg,
|
||||
setting,
|
||||
modifier,
|
||||
value,
|
||||
error);
|
||||
g_object_thaw_notify (G_OBJECT (setting));
|
||||
return success;
|
||||
|
||||
out_fail_read_only:
|
||||
nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, _("the property can't be changed"));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue