Wireshark-commits: [Wireshark-commits] master 30ff173: Qt: Always make the packet list row heights

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 23 Sep 2015 20:53:25 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=30ff173a8792aede0901803b2dc37948e7406df7
Submitter: Gerald Combs (gerald@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

30ff173 by Gerald Combs (gerald@xxxxxxxxxxxxx):

    Qt: Always make the packet list row heights uniform.
    
    In tests here using GTK+ 2.24 and 3.10, GtkTreeView handles multi-line
    items by adjusting the height for all rows, but only after the number of
    multi-line items exceeds some sort of threshold. For a packet capture
    which contains a few DNS packets and a lot of TCP packets, if I change
    "Standard query" to "Standard\nquery" in packet-dns.c I get
    single-height packet list items. If I change "[TCP segment of a
    reassembled PDU]" to "[TCP segment of a\nreassembled PDU]" in
    packet-tcp.c (which results in more multi-line column strings) I get
    double-height packet list items.
    
    The current Qt code initially sets the uniformRowHeights property then
    falls back to variable row heights if we run across a multi-line column
    string. This adds a lot of logic which can impact other functionality
    (e.g. column widths) and recalculating row heights is painfully slow for
    large numbers of packets.
    
    Instead of trying to manage variable row heights, always enable
    uniformRowHeights. Track the maximum newline count and trigger a row
    height adjustment when it changes. This mimics the GTK+ UI behavior,
    although it should be more reliable.
    
    Note that we need to adjust some numbers in RelatedPacketDelegate.
    
    Change-Id: I289e963b6f00338c4374e602fa3fc83d04554519
    Ping-Bug: 11515
    Ping-Bug: 10924
    Reviewed-on: https://code.wireshark.org/review/10628
    Reviewed-by: Gerald Combs <gerald@xxxxxxxxxxxxx>
    

Actions performed:

    from  3ff5afd   Add a test to verify we pre-allocated enough hf entries.
    adds  30ff173   Qt: Always make the packet list row heights uniform.


Summary of changes:
 ui/qt/packet_list.cpp             |   30 +++++++++----------
 ui/qt/packet_list.h               |    2 +-
 ui/qt/packet_list_model.cpp       |   59 +++++++++++++++++++++++--------------
 ui/qt/packet_list_model.h         |   14 ++++-----
 ui/qt/related_packet_delegate.cpp |    1 +
 5 files changed, 60 insertions(+), 46 deletions(-)