aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/packet_list.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-11-27 00:44:55 +0000
committerRoland Knall <rknall@gmail.com>2019-11-28 14:13:57 +0000
commit2d12ec67a37d27c4d924a628c7e657762cda8bd4 (patch)
tree33eea71d5081a20018528c5817b99b21b0c5538c /ui/qt/packet_list.cpp
parent43701644196eba7b0114bf882ebb48fe35669816 (diff)
Qt: fix erratic expansion of tree item when switching packets
ProtoTree::setRootNode() is designed to update the model with the new packet tree, and additionally expand tree items in its view. When the current selected packet is changed, it must use this method to ensure that collapsed trees are properly expanded. Fix this regression. It was not entirely clear that framesSelected can no longer use previous state, so document it explicitly. Remove the call to QTreeView::reset(), it ends up calling QAbstractItemView::reset() which touches the selection model that refers invalidated proto_node memory. The reset function of the view is automatically called the model is reset, so the call was not needed anyway. Test: open test/captures/tls13-rfc8446.pcap, expand TLS, TLS Record, and select "Content Type". Change from frame 1 to 2, and then 3. Observe that the expanded state remains constant with no flickering. In frame 3, observe that the tree remains expanded even if no item is selected. Change-Id: I0c820711f1a62aa51ac100f8ac5c89265c51eb18 Fixes: v3.3.0rc0-6-gcfee0f8082 ("Qt: Remove frameSelect signal") Reviewed-on: https://code.wireshark.org/review/35230 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/packet_list.cpp')
-rw-r--r--ui/qt/packet_list.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 61aea7de74..53b88ae23d 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -531,6 +531,8 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
related_packet_delegate_.clear();
+ // The previous dissection state has been invalidated by cf_select_packet
+ // above, receivers must clear the previous state and apply the updated one.
emit framesSelected(QList<int>() << row);
if (!cap_file_->edt) {