diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2018-09-09 20:30:54 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2018-09-10 07:26:00 +0000 |
commit | 7d7175a1308d914495bba5cde27e5bd2715d8644 (patch) | |
tree | 83629df366697fb98646ba3233ed0898f3b5c188 /ui/qt | |
parent | 7ce18dc465f364424b0625064851deed659ddfa9 (diff) |
Qt: Restore column visibility when loading packets
Always restore column visibility when loading packets to avoid some
situations where the column hidden state was incorrect.
This fixes the following scenario:
- Apply a column and hide it using the column popup menu
- Apply another column and remove it using the column popup menu
- Close and reopen the capture file
- Observe the hidden column is shown, but with wrong width
Change-Id: I00531907b2383c6605a2d62e8243092906037d0c
Reviewed-on: https://code.wireshark.org/review/29516
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/packet_list.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 070b2d4a37..71f60f2bf1 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1198,13 +1198,15 @@ void PacketList::deleteAllPacketComments() void PacketList::setCaptureFile(capture_file *cf) { - if (cf) { - // We're opening. Restore our column widths. - header()->restoreState(column_state_); - } cap_file_ = cf; - if (cap_file_ && columns_changed_) { - columnsChanged(); + if (cf) { + if (columns_changed_) { + columnsChanged(); + } else { + // Restore columns widths and visibility. + header()->restoreState(column_state_); + setColumnVisibility(); + } } packet_list_model_->setCaptureFile(cf); create_near_overlay_ = true; |