summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2015-11-23 14:06:59 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-11-23 17:03:04 +0000
commit688b3407fad6cc906bd19342fc0228947648c337 (patch)
tree55039c1152c536226a14b84e3d36bfa833164a47
parentbc03ab1a0b4329c1c448164ef0548d187754638a (diff)
downloadwireshark-688b3407fad6cc906bd19342fc0228947648c337.tar.gz
Qt: Fixed more column issues when changing profile.
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 <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> (cherry picked from commit 7324555c1fef30a435a9be3c11c936b735507781) Reviewed-on: https://code.wireshark.org/review/12075
-rw-r--r--ui/qt/packet_list.cpp12
-rw-r--r--ui/qt/packet_list.h1
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();