diff options
| author | Michael Biebl <biebl@debian.org> | 2025-02-12 13:46:50 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-02-12 13:46:50 +0100 |
| commit | 8bdf070ff046f482f6eb5e2b15ebc216f5d1e3da (patch) | |
| tree | f706478d189d54c6532e8863d4b0d5ff5575af60 /src/nmcli/utils.c | |
| parent | 818258cf34b83fbc754633295e1052d4752d7b15 (diff) | |
New upstream version 1.51.90 upstream/1.51.90
Diffstat (limited to 'src/nmcli/utils.c')
| -rw-r--r-- | src/nmcli/utils.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/nmcli/utils.c b/src/nmcli/utils.c index c65a5486..a613c28f 100644 --- a/src/nmcli/utils.c +++ b/src/nmcli/utils.c @@ -1016,6 +1016,8 @@ _print_fill(const NmcConfig *nmc_config, PrintDataHeaderCell *header_cell; guint col_idx; const NMMetaAbstractInfo *info; + const char *setting_name; + gboolean is_prop; col = &cols[i_col]; if (!col->is_leaf) @@ -1036,14 +1038,23 @@ _print_fill(const NmcConfig *nmc_config, header_cell->to_print = FALSE; header_cell->title = nm_meta_abstract_info_get_name(info, TRUE); - if (nmc_config->multiline_output && col->parent_col - && NM_IN_SET(info->meta_type, - &nm_meta_type_property_info, - &nmc_meta_type_generic_info)) { - header_cell->title = g_strdup_printf( - "%s.%s", - nm_meta_abstract_info_get_name(col->parent_col->selection_item->info, FALSE), - header_cell->title); + + is_prop = + col->parent_col + && NM_IN_SET(info->meta_type, &nm_meta_type_property_info, &nmc_meta_type_generic_info); + + if (is_prop) { + /* Some properties has different name for the user than internally in + * libnm and D-Bus. Make the conversion from libnm names to user names. + */ + setting_name = + nm_meta_abstract_info_get_name(col->parent_col->selection_item->info, FALSE); + header_cell->title = + nmc_setting_propname_libnm_to_user(setting_name, header_cell->title); + } + + if (nmc_config->multiline_output && is_prop) { + header_cell->title = g_strdup_printf("%s.%s", setting_name, header_cell->title); header_cell->title_to_free = TRUE; } } |