libnm-core: add direct_strv_not_null property

This property indicates that a non-null strv array is expected, and
an empty strv array should be returned instead of NULL if it hadn't
been created yet.
This commit is contained in:
Jan Vaclav 2024-01-08 12:45:56 +01:00
parent 66887fafef
commit 63c4827af2
2 changed files with 5 additions and 1 deletions

View file

@ -859,7 +859,7 @@ _nm_setting_property_get_property_direct(GObject *object,
value,
nm_strvarray_get_strv_full_dup(p_val->arr,
NULL,
FALSE,
property_info->direct_strv_not_null,
property_info->direct_strv_preserve_empty));
return;
}

View file

@ -868,6 +868,10 @@ struct _NMSettInfoProperty {
* an empty array. */
bool direct_strv_preserve_empty : 1;
/* This flag indicates that an empty strv array should be returned
* instead of NULL if it hadn't been created yet. */
bool direct_strv_not_null : 1;
/* Usually, properties that are set to the default value for the GParamSpec
* are not serialized to GVariant (and NULL is returned by to_dbus_data().
* Set this flag to force always converting the property even if the value