diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-10-15 23:14:10 +0200 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-10-19 17:41:12 +0000 |
commit | a0113a5eb3329b815e1790f8dc42c48fa6ffbcd7 (patch) | |
tree | 98790347f65517d02597b14d6115ccd9d3f6c0e3 /ui/qt/packet_list.cpp | |
parent | 6f9801a6279f01ec004f1796bc2fd9d8f1110a99 (diff) |
Qt: fix time shift
Add a timeShifted signal to TimeShiftDialog and use it to update the
packet list and model. Add drawCurrentPacket to PacketList so that we
can do a more thorough job of redrawing the current packet and tree.
Bug: 11575
Change-Id: I960d8cdbf6872e3f71007cb4d2bbd5457f268257
Reviewed-on: https://code.wireshark.org/review/11068
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/packet_list.cpp')
-rw-r--r-- | ui/qt/packet_list.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index e77b9a3631..304a2dff85 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -615,18 +615,22 @@ void PacketList::initHeaderContextMenu() } } +void PacketList::drawCurrentPacket() +{ + QModelIndex current_index = currentIndex(); + setCurrentIndex(QModelIndex()); + if (current_index.isValid()) { + setCurrentIndex(current_index); + } +} + // Redraw the packet list and detail. Called from many places. // XXX We previously re-selected the packet here, but that seems to cause // automatic scrolling problems. void PacketList::redrawVisiblePackets() { - if (!cap_file_) return; - - if (cap_file_->edt && cap_file_->edt->tree) { - proto_tree_->fillProtocolTree(cap_file_->edt->tree); - } - update(); header()->update(); + drawCurrentPacket(); } // prefs.col_list has changed. @@ -1067,6 +1071,13 @@ void PacketList::unsetAllTimeReferences() create_far_overlay_ = true; } +void PacketList::applyTimeShift() +{ + packet_list_model_->applyTimeShift(); + redrawVisiblePackets(); + // XXX emit packetDissectionChanged(); ? +} + void PacketList::showHeaderMenu(QPoint pos) { header_ctx_column_ = header()->logicalIndexAt(pos); |