Qt: Restore multi custom column width and align

Put custom column field settings in quotes in the recent file to
support multi custom columns which contains space.  Otherwise the
space will be removed in prefs_get_string_list() and the field will
not match when reading the recent file.

Change-Id: Ic6e2b1e02d68970a4e11fbecbe55a7b10f8b10dd
Reviewed-on: https://code.wireshark.org/review/22349
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Stig Bjørlykke 2017-06-22 10:48:34 -04:00 committed by Anders Broman
parent 130b514be2
commit 578f2a15bb
2 changed files with 2 additions and 4 deletions

View File

@ -1632,7 +1632,7 @@ packet_list_recent_write_all(FILE *rf)
for (col = 0; col < num_cols; col++) {
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));
}

View File

@ -604,7 +604,6 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
ctx_menu_.exec(event->globalPos());
ctx_column_ = -1;
decode_as_->setData(QVariant());
}
// Auto scroll if:
@ -995,7 +994,7 @@ void PacketList::writeRecent(FILE *rf) {
}
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));
}
@ -1007,7 +1006,6 @@ void PacketList::writeRecent(FILE *rf) {
}
}
fprintf (rf, "\n");
}
bool PacketList::contextMenuActive()