aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/packet_list_model.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2015-09-20 13:17:07 -0700
committerGerald Combs <gerald@wireshark.org>2015-09-21 15:40:29 +0000
commit50ff8ae0c7395454a6483d5013283af7fa288809 (patch)
tree126997beafbe4544d2e9446c82e6fed5b0f036a5 /ui/qt/packet_list_model.h
parent4680c8b42904d7fdda9ba1175e3e808953912bad (diff)
Qt: Add idle dissection.
Features such as sorting and scroll bar colorization require fully-dissected packets. We currently do dissection at the wrong time -- *after* the user clicks on a packet list column header or moves the scrollbar. Add a timer + slot that dissects packets when the UI is idle so that our packets are at least partially dissected when we need them. Change-Id: I024c590af2250d67404a520f118e46ec0c49cd71 Reviewed-on: https://code.wireshark.org/review/10593 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_model.h')
-rw-r--r--ui/qt/packet_list_model.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/qt/packet_list_model.h b/ui/qt/packet_list_model.h
index 8a41712555..7d5af30663 100644
--- a/ui/qt/packet_list_model.h
+++ b/ui/qt/packet_list_model.h
@@ -38,11 +38,14 @@
#include "cfile.h"
+class QElapsedTimer;
+
class PacketListModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit PacketListModel(QObject *parent = 0, capture_file *cf = NULL);
+ ~PacketListModel();
void setCaptureFile(capture_file *cf);
QModelIndex index(int row, int column,
const QModelIndex & = QModelIndex()) const;
@@ -86,6 +89,7 @@ public slots:
void setMonospaceFont(const QFont &mono_font, int row_height);
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void flushVisibleRows();
+ void dissectIdle(bool reset = false);
private:
capture_file *cap_file_;
@@ -106,6 +110,10 @@ private:
static capture_file *sort_cap_file_;
static bool recordLessThan(PacketListRecord *r1, PacketListRecord *r2);
+ QElapsedTimer *idle_dissection_timer_;
+ int idle_dissection_row_;
+
+
private slots:
void emitItemHeightChanged(const QModelIndex &ih_index);
};