3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +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

@ -59,7 +59,7 @@ void proxy_properties_display(const struct proxy_interface *proxy,
if (!proxy->type->properties)
return;
display_table_header(caption, "%s%-*s %-*s%-*s", margin,
display_table_header(caption, "%s%-*s %-*s %-*s", margin,
8, "Settable",
name_column_width, "Property",
value_column_width, "Value");
@ -69,29 +69,16 @@ void proxy_properties_display(const struct proxy_interface *proxy,
for (i = 0; properties[i].name; i++) {
const char *str;
size_t len;
size_t j;
if (!properties[i].tostr)
continue;
str = properties[i].tostr(data);
len = str ? strlen(str) : 0;
display("%s%*s %-*s%-.*s\n", margin,
8, properties[i].is_read_write ?
display_table_row(MARGIN, 3, 8, properties[i].is_read_write ?
COLOR_BOLDGRAY " *" COLOR_OFF : "",
name_column_width, properties[i].name,
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);
name_column_width, properties[i].name,
value_column_width, str ? : "");
}
}