mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 12:18:13 +02:00
nmcli: add clear_all_fcn() hook for mutllist property types
This commit is contained in:
parent
3a8fe7ad45
commit
a1c7b04664
2 changed files with 14 additions and 4 deletions
|
|
@ -1836,8 +1836,13 @@ _set_fcn_multilist (ARGS_SET_FCN)
|
|||
gs_free const char **strv = NULL;
|
||||
gsize i, j, nstrv;
|
||||
|
||||
if (_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (property_info, modifier, value))
|
||||
return _gobject_property_reset_default (setting, property_info->property_name);
|
||||
if (_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (property_info, modifier, value)) {
|
||||
if (property_info->property_typ_data->subtype.multilist.clear_all_fcn) {
|
||||
property_info->property_typ_data->subtype.multilist.clear_all_fcn (setting);
|
||||
return TRUE;
|
||||
}
|
||||
return _gobject_property_reset (setting, property_info->property_name, FALSE);
|
||||
}
|
||||
|
||||
if ( _SET_FCN_DO_REMOVE (modifier, value)
|
||||
&& ( property_info->property_typ_data->subtype.multilist.remove_by_idx_fcn_u32
|
||||
|
|
@ -1890,8 +1895,12 @@ _set_fcn_multilist (ARGS_SET_FCN)
|
|||
}
|
||||
nstrv = j;
|
||||
|
||||
if (_SET_FCN_DO_SET_ALL (modifier, value))
|
||||
_gobject_property_reset (setting, property_info->property_name, FALSE);
|
||||
if (_SET_FCN_DO_SET_ALL (modifier, value)) {
|
||||
if (property_info->property_typ_data->subtype.multilist.clear_all_fcn)
|
||||
property_info->property_typ_data->subtype.multilist.clear_all_fcn (setting);
|
||||
else
|
||||
_gobject_property_reset (setting, property_info->property_name, FALSE);
|
||||
}
|
||||
|
||||
for (i = 0; i < nstrv; i++) {
|
||||
if (_SET_FCN_DO_REMOVE (modifier, value)) {
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ struct _NMMetaPropertyTypData {
|
|||
struct {
|
||||
guint32 (*get_num_fcn_u32) (NMSetting *setting);
|
||||
guint (*get_num_fcn_u) (NMSetting *setting);
|
||||
void (*clear_all_fcn) (NMSetting *setting);
|
||||
gboolean (*add_fcn) (NMSetting *setting,
|
||||
const char *item);
|
||||
void (*add2_fcn) (NMSetting *setting,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue