clients: change nm_meta_abstract_info_get() to report defaults

Return a boolean to indicate whether the value is the default one, so
that the caller can choose to hide it.
This commit is contained in:
Beniamino Galvani
2018-02-27 15:34:49 +01:00
parent defe869ee3
commit 1f2319dcb9
9 changed files with 21 additions and 1 deletions

View File

@@ -75,6 +75,7 @@ _meta_type_nmc_generic_info_get_fcn (const NMMetaAbstractInfo *abstract_info,
NMMetaAccessorGetType get_type,
NMMetaAccessorGetFlags get_flags,
NMMetaAccessorGetOutFlags *out_flags,
gboolean *out_is_default,
gpointer *out_to_free)
{
const NmcMetaGenericInfo *info = (const NmcMetaGenericInfo *) abstract_info;
@@ -97,6 +98,7 @@ _meta_type_nmc_generic_info_get_fcn (const NMMetaAbstractInfo *abstract_info,
get_type,
get_flags,
out_flags,
out_is_default,
out_to_free);
}
@@ -1152,6 +1154,7 @@ _print_fill (const NmcConfig *nmc_config,
text_get_type,
text_get_flags,
&text_out_flags,
NULL,
(gpointer *) &to_free);
if (NM_FLAGS_HAS (text_out_flags, NM_META_ACCESSOR_GET_OUT_FLAGS_STRV)) {
if (value) {
@@ -1178,6 +1181,7 @@ _print_fill (const NmcConfig *nmc_config,
NM_META_ACCESSOR_GET_TYPE_TERMFORMAT,
NM_META_ACCESSOR_GET_FLAGS_NONE,
&color_out_flags,
NULL,
NULL),
&cell->term_color,
&cell->term_format);