summaryrefslogtreecommitdiff
path: root/ui/qt/packet_list.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-03-15 09:49:48 -0700
committerGerald Combs <gerald@wireshark.org>2016-03-21 22:10:21 +0000
commitbb48c859c98b00320398f54f14fd9b16f4fa3cf2 (patch)
tree4322ff31083f04ce59179d248c328c342ae14732 /ui/qt/packet_list.cpp
parentdf23ccb7d7b49970746c04d9031f03fef838ddd5 (diff)
downloadwireshark-bb48c859c98b00320398f54f14fd9b16f4fa3cf2.tar.gz
Qt: Normalize timerEvents
Make our timerEvent code more consistent. Make sure we use timer IDs and that we call our base class timerEvent everywhere. Change-Id: Ib67daa459a8a2f9b67487c3952b7b35c7f162f7e Reviewed-on: https://code.wireshark.org/review/14480 Petri-Dish: Gerald Combs <gerald@wireshark.org> 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.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index dba7f54f7f..80331d7c06 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -559,17 +559,18 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
// scrollToBottom() from rowsInserted().
void PacketList::timerEvent(QTimerEvent *event)
{
- QTreeView::timerEvent(event);
-
- if (event->timerId() == tail_timer_id_
- && rows_inserted_
- && capture_in_progress_
- && tail_at_end_) {
- scrollToBottom();
- rows_inserted_ = false;
- } else if (event->timerId() == overlay_timer_id_ && !capture_in_progress_) {
- if (create_near_overlay_) drawNearOverlay();
- if (create_far_overlay_) drawFarOverlay();
+ if (event->timerId() == tail_timer_id_) {
+ if (rows_inserted_ && capture_in_progress_ && tail_at_end_) {
+ scrollToBottom();
+ rows_inserted_ = false;
+ }
+ } else if (event->timerId() == overlay_timer_id_) {
+ if (!capture_in_progress_) {
+ if (create_near_overlay_) drawNearOverlay();
+ if (create_far_overlay_) drawFarOverlay();
+ }
+ } else {
+ QTreeView::timerEvent(event);
}
}