mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 13:40:11 +01:00
libnm: return NULL for boxed strv properties of NMSettingMatch
The API does not allow to distinguish between an unset (NULL) or empty strv array. For example, nm_setting_match_get_paths() never returns %NULL, but returns an empty strv array. On the other hand, the GObject properties of type G_TYPE_STRV have a default value of %NULL. That means, also the getter should map both unset and empty to %NULL. Note that this is a change in behavior w.r.t. 1.24.0 API, where match.interface-name property would return an empty strv array. Regrading the other API, this is no change because it is new API and we will fix it before 1.26.0 release.
This commit is contained in:
parent
d69f057a65
commit
62263e706f
1 changed files with 4 additions and 4 deletions
|
|
@ -659,16 +659,16 @@ get_property (GObject *object, guint prop_id,
|
|||
|
||||
switch (prop_id) {
|
||||
case PROP_INTERFACE_NAME:
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv (&self->interface_name, NULL));
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->interface_name, NULL));
|
||||
break;
|
||||
case PROP_KERNEL_COMMAND_LINE:
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv (&self->kernel_command_line, NULL));
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->kernel_command_line, NULL));
|
||||
break;
|
||||
case PROP_DRIVER:
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv (&self->driver, NULL));
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->driver, NULL));
|
||||
break;
|
||||
case PROP_PATH:
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv (&self->path, NULL));
|
||||
g_value_set_boxed (value, nm_strvarray_get_strv_non_empty (self->path, NULL));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue