From 76b1d4871c5712ee8405828f3b01b108660fe901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Thu, 22 Jun 2017 10:48:34 -0400 Subject: Qt: Restore multi custom column width and align MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman (cherry picked from commit 578f2a15bb7534b3aad315a92989b6e4d577e4c3) Reviewed-on: https://code.wireshark.org/review/22358 Reviewed-by: Stig Bjørlykke --- ui/gtk/packet_list.c | 2 +- ui/qt/packet_list.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/gtk/packet_list.c b/ui/gtk/packet_list.c index 6350ba74cc..5adfbb7702 100644 --- a/ui/gtk/packet_list.c +++ b/ui/gtk/packet_list.c @@ -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)); } diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 2a81d446c5..e966d6deaf 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -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() -- cgit v1.2.1