From 7324555c1fef30a435a9be3c11c936b735507781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 23 Nov 2015 14:06:59 +0100 Subject: [PATCH] Qt: Fixed more column issues when changing profile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When changing profile without a loaded capture file we have to rebuild cap_file_->cinfo when a capture is loaded. Bug: 11493 Change-Id: I9b561a360236056c104cfdb478b855fa550325e2 Reviewed-on: https://code.wireshark.org/review/12068 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- ui/qt/packet_list.cpp | 12 ++++++++++-- ui/qt/packet_list.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index c027581c7d..f10390ea94 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -249,7 +249,8 @@ PacketList::PacketList(QWidget *parent) : create_far_overlay_(true), capture_in_progress_(false), tail_timer_id_(0), - rows_inserted_(false) + rows_inserted_(false), + columns_changed_(false) { QMenu *main_menu_item, *submenu; QAction *action; @@ -635,7 +636,10 @@ void PacketList::redrawVisiblePackets() { // prefs.col_list has changed. void PacketList::columnsChanged() { - if (!cap_file_) return; + if (!cap_file_) { + columns_changed_ = true; + return; + } prefs.num_cols = g_list_length(prefs.col_list); col_cleanup(&cap_file_->cinfo); @@ -643,6 +647,7 @@ void PacketList::columnsChanged() setColumnVisibility(); create_far_overlay_ = true; packet_list_model_->resetColumns(); + columns_changed_ = false; } // Fields have changed, update custom columns @@ -977,6 +982,9 @@ void PacketList::setCaptureFile(capture_file *cf) header()->restoreState(column_state_); } cap_file_ = cf; + if (cap_file_ && columns_changed_) { + columnsChanged(); + } packet_list_model_->setCaptureFile(cf); create_near_overlay_ = true; } diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h index 61757866b4..eaa1a3bda9 100644 --- a/ui/qt/packet_list.h +++ b/ui/qt/packet_list.h @@ -116,6 +116,7 @@ private: int tail_timer_id_; bool tail_at_end_; bool rows_inserted_; + bool columns_changed_; void setFrameReftime(gboolean set, frame_data *fdata); void setColumnVisibility();