diff options
author | Roland Knall <rknall@gmail.com> | 2019-11-21 10:50:41 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-11-21 10:59:05 +0000 |
commit | cfee0f8082578810cbc88213edde3562f2a7bf73 (patch) | |
tree | a7faa696f466c3fc004709a602474af79361910d /ui/qt/packet_list.cpp | |
parent | ecb90a4e25ac9aad866c76a9d65839dc27c77519 (diff) |
Qt: Remove frameSelect signal
As all frameSelect signals now transport a QList<int> of selected
frames, use this instead
Change-Id: I1888e45a4df997920aebde9706ca0ae803bdba03
Reviewed-on: https://code.wireshark.org/review/35176
Petri-Dish: Roland Knall <rknall@gmail.com>
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.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index ce2e0202f8..b9f587a9bb 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -475,7 +475,6 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS rows << idx.row(); } - emit frameSelected(-1); emit framesSelected(rows); emit fieldSelected(0); cf_unselect_packet(cap_file_); @@ -531,9 +530,7 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS in_history_ = false; related_packet_delegate_.clear(); - if (proto_tree_) proto_tree_->clear(); - emit frameSelected(row); emit framesSelected(QList<int>() << row); if (!cap_file_->edt) { @@ -542,10 +539,9 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS return; } - if (proto_tree_ && cap_file_->edt->tree) { + if (cap_file_->edt->tree) { packet_info *pi = &cap_file_->edt->pi; related_packet_delegate_.setCurrentFrame(pi->num); - proto_tree_->setRootNode(cap_file_->edt->tree); conversation_t *conv = find_conversation_pinfo(pi, 0); if (conv) { related_packet_delegate_.setConversation(conv); @@ -1172,7 +1168,9 @@ void PacketList::freeze() // It looks like GTK+ sends a cursor-changed signal at this point but Qt doesn't // call selectionChanged. related_packet_delegate_.clear(); - proto_tree_->clear(); + + /* Clears packet list as well as byteview */ + emit framesSelected(QList<int>()); } void PacketList::thaw(bool restore_selection) @@ -1185,10 +1183,12 @@ void PacketList::thaw(bool restore_selection) // resized the columns manually since they were initially loaded. header()->restoreState(column_state_); - if (restore_selection && frozen_row_ > -1) { - // This updates our selection, which redissects the current packet, - // which is needed when we're called from MainWindow::layoutPanes. - setCurrentIndex(packet_list_model_->index(frozen_row_, 0)); + if (restore_selection && frozen_row_ > -1 && selectionModel()) { + /* This updates our selection, which redissects the current packet, + * which is needed when we're called from MainWindow::layoutPanes. + * Also, this resets all ProtoTree and ByteView data */ + QModelIndex restored = packet_list_model_->index(frozen_row_, 0); + selectionModel()->select(restored, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } frozen_row_ = -1; } |