aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/packet_list.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-09-16 10:46:45 -0700
committerGerald Combs <gerald@wireshark.org>2015-09-17 19:37:48 +0000
commitae4d99b670c97e418e9d14417827326d912e76fb (patch)
treea4bfe18a2b80b3c356f13a63fd140613e2fb1880 /ui/qt/packet_list.cpp
parentdabdc30686c6cbce23691bbed01edbea44efb504 (diff)
Packet list speedups.
beginInsertRows + endInsertRows is expensive. Instead of calling them each time we add a packet to the list, queue up a list of visible packets and flush it during the next UI update. Assume that none of our column data has newlines. Enable uniformRowHeights and only disable it when we need to. Note that this requires further work. Ping-Bug: 11515 Ping-Bug: 10924 Change-Id: Ifbdd2964b174247a4745d4889ebda5bf3b886ba4 Reviewed-on: https://code.wireshark.org/review/10553 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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 4e5bd43b72..cabdbbbf81 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -374,6 +374,7 @@ PacketList::PacketList(QWidget *parent) :
g_assert(gbl_cur_packet_list == NULL);
gbl_cur_packet_list = this;
+ connect(packet_list_model_, SIGNAL(rowHeightsVary()), this, SLOT(rowHeightsVary()));
connect(packet_list_model_, SIGNAL(goToPacket(int)), this, SLOT(goToPacket(int)));
connect(wsApp, SIGNAL(addressResolutionChanged()), this, SLOT(redrawVisiblePackets()));
@@ -728,6 +729,13 @@ void PacketList::setAutoScroll(bool enabled)
}
}
+// Called when we finish reading, reloading, rescanning, and retapping
+// packets.
+void PacketList::captureFileReadFinished()
+{
+ packet_list_model_->flushVisibleRows();
+}
+
void PacketList::freeze()
{
setUpdatesEnabled(false);
@@ -765,6 +773,7 @@ void PacketList::clear() {
create_near_overlay_ = true;
create_far_overlay_ = true;
+ setUniformRowHeights(true);
setColumnVisibility();
}
@@ -1226,6 +1235,14 @@ void PacketList::sectionMoved(int, int, int)
wsApp->emitAppSignal(WiresharkApplication::ColumnsChanged);
}
+void PacketList::rowHeightsVary()
+{
+ // This impairs performance considerably for large numbers of packets.
+ // We should probably move a bunch of the code in ::data to
+ // RelatedPacketDelegate and make it the delegate for everything.
+ setUniformRowHeights(false);
+}
+
void PacketList::copySummary()
{
if (!currentIndex().isValid()) return;