3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

client: update dbus-proxy to use display_table_row

This commit is contained in:
James Prestwood 2022-07-07 10:55:00 -07:00 committed by Denis Kenzior
parent c7b0c57010
commit e1d485029b

View File

@ -69,29 +69,16 @@ void proxy_properties_display(const struct proxy_interface *proxy,
for (i = 0; properties[i].name; i++) { for (i = 0; properties[i].name; i++) {
const char *str; const char *str;
size_t len;
size_t j;
if (!properties[i].tostr) if (!properties[i].tostr)
continue; continue;
str = properties[i].tostr(data); str = properties[i].tostr(data);
len = str ? strlen(str) : 0;
display("%s%*s %-*s%-.*s\n", margin, display_table_row(MARGIN, 3, 8, properties[i].is_read_write ?
8, properties[i].is_read_write ?
COLOR_BOLDGRAY " *" COLOR_OFF : "", COLOR_BOLDGRAY " *" COLOR_OFF : "",
name_column_width, properties[i].name, name_column_width, properties[i].name,
value_column_width, str ? : ""); value_column_width, str ? : "");
if (len <= value_column_width)
continue;
/* Display remaining data */
for (j = value_column_width; j < len; j += value_column_width)
display("%s%*s %-*s%-.*s\n", margin, 8, "",
name_column_width, "", value_column_width,
str + j);
} }
} }