Qt: Clear the packet list selection before freezing it.
authorGerald Combs <gerald@wireshark.org>
Tue, 21 Jun 2016 22:13:30 +0000 (15:13 -0700)
committerAnders Broman <a.broman58@gmail.com>
Wed, 22 Jun 2016 05:00:17 +0000 (05:00 +0000)
Call selectionModel()->clear() before removing our model. This will
hopefully make sure we don't end up with an invalid selection in
selectionChanged().

Clear the selection model before clearing the model while we're here.

Change-Id: I1007eeaa480afa0fb31dafc15a49ca6c247b30c8
Reviewed-on: https://code.wireshark.org/review/16062
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Kenny Root <kenny@the-b.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
ui/qt/packet_list.cpp

index 4a153ff1614ff645df55f6195a93d3937de684b9..14b799cc11e67f636cbde543477d3f391d5cc52f 100644 (file)
@@ -893,6 +893,7 @@ void PacketList::freeze()
 {
     setUpdatesEnabled(false);
     column_state_ = header()->saveState();
+    selectionModel()->clear();
     setModel(NULL);
     // It looks like GTK+ sends a cursor-changed signal at this point but Qt doesn't
     // call selectionChanged.
@@ -917,6 +918,7 @@ void PacketList::thaw()
 void PacketList::clear() {
     //    packet_history_clear();
     related_packet_delegate_.clear();
+    selectionModel()->clear();
     packet_list_model_->clear();
     proto_tree_->clear();
     byte_view_tab_->clear();