aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2020-01-09 16:26:34 +0100
committerAnders Broman <a.broman58@gmail.com>2020-01-10 04:59:07 +0000
commit1bbac91d33ea9711de1dd052fea74cbaff72761f (patch)
tree88d34edc1cf224d69879c580ecdb4b7bdbe5a0b9
parente3a92cf8f63270dc4eea565f050cfd98c121bfa2 (diff)
Qt: Fix related packet delegate
Recent updates broke the related packet delegate in such a way, that the direction arrow for the current packet was shown, but no indicator for any other packet. This fix resets the packet indicator properly, if a new frame is selected. Note: This means, that the caller has to reset the delegate, but this was the original behavior anyway Bug: 16316 Change-Id: Ief2396c65303a2226ad9fdd87969b667b2f1274d Reviewed-on: https://code.wireshark.org/review/35720 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--ui/qt/models/related_packet_delegate.cpp12
-rw-r--r--ui/qt/models/related_packet_delegate.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/ui/qt/models/related_packet_delegate.cpp b/ui/qt/models/related_packet_delegate.cpp
index ac04a586d0..612ba48dd6 100644
--- a/ui/qt/models/related_packet_delegate.cpp
+++ b/ui/qt/models/related_packet_delegate.cpp
@@ -280,9 +280,19 @@ void RelatedPacketDelegate::clear()
conv_ = NULL;
}
+void RelatedPacketDelegate::setCurrentFrame(guint32 current_frame)
+ {
+ current_frame_ = current_frame;
+ foreach (int frame_num, related_frames_.keys()) {
+ addRelatedFrame(frame_num, related_frames_[frame_num]);
+ }
+ }
+
void RelatedPacketDelegate::addRelatedFrame(int frame_num, ft_framenum_type_t framenum_type)
{
- related_frames_[frame_num] = framenum_type;
+ if (!related_frames_.keys().contains(frame_num))
+ related_frames_[frame_num] = framenum_type;
+
// Last match wins. Last match might not make sense, however.
if (current_frame_ > 0) {
switch (framenum_type) {
diff --git a/ui/qt/models/related_packet_delegate.h b/ui/qt/models/related_packet_delegate.h
index 326ffca752..f77c9b3664 100644
--- a/ui/qt/models/related_packet_delegate.h
+++ b/ui/qt/models/related_packet_delegate.h
@@ -26,7 +26,7 @@ class RelatedPacketDelegate : public QStyledItemDelegate
public:
RelatedPacketDelegate(QWidget *parent = 0);
void clear();
- void setCurrentFrame(guint32 current_frame) { current_frame_ = current_frame; }
+ void setCurrentFrame(guint32 current_frame);
void setConversation(struct conversation *conv);
public slots: