Better format for the recent file's column.width preference

Write the "Packet list column pixel widths" preference value in a
format that is both more human friendly and is more consistent with
other similarly formatted multivalued preference values.

From this ...

> # Packet list column pixel widths.
> # Each pair of strings consists of a column format and its pixel width.
> column.width: %m, 75, %t, 72, %s, 113, %d, 113, %p, 92, %L, 82, %i, 475

To this ...

> # Packet list column pixel widths.
> # Each pair of strings consists of a column format and its pixel width.
> column.width:
>         %m, 75,
>         %t, 72,
>         %s, 113,
>         %d, 113,
>         %p, 92,
>         %L, 82,
>         %i, 475

The preference reading code already accepts this new format.

Change-Id: Id731ec81e8ebf87ecfb268e48dfeaa96d8e00668
Reviewed-on: https://code.wireshark.org/review/31140
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jim Young 2018-12-20 00:45:11 -05:00 committed by Anders Broman
parent eb3066d64b
commit bbef2a87ff
1 changed files with 4 additions and 4 deletions

View File

@ -999,16 +999,16 @@ void PacketList::writeRecent(FILE *rf) {
gint col, width, col_fmt;
gchar xalign;
fprintf (rf, "%s:", RECENT_KEY_COL_WIDTH);
fprintf (rf, "%s:\n", RECENT_KEY_COL_WIDTH);
for (col = 0; col < prefs.num_cols; col++) {
if (col > 0) {
fprintf (rf, ",");
fprintf (rf, ",\n");
}
col_fmt = get_column_format(col);
if (col_fmt == COL_CUSTOM) {
fprintf (rf, " \"%%Cus:%s\",", get_column_custom_fields(col));
fprintf (rf, " \"%%Cus:%s\",", get_column_custom_fields(col));
} else {
fprintf (rf, " %s,", col_format_to_string(col_fmt));
fprintf (rf, " %s,", col_format_to_string(col_fmt));
}
width = recent_get_column_width (col);
xalign = recent_get_column_xalign (col);