Wireshark-commits: [Wireshark-commits] master 4980d50: Qt: Use correct column width when switching

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 26 Nov 2015 17:17:00 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=4980d505f268b2b1d2ebabf815f3d0ce34e8cd71
Submitter: Stig Bj?rlykke (stig@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

4980d50 by Stig Bjørlykke (stig@xxxxxxxxxxxxx):

    Qt: Use correct column width when switching profile
    
    QTreeView::setColumnHidden() saves column width on hide and restores
    column width on show.  When switching from a profile with hidden
    columns to a profile where this columns are shown we get a
    sectionResized() signal with the saved width from the old profile,
    initiated from columnsChanged() -> setColumnVisibility().
    We must avoid setting this as a new column width because this is
    recent values from a old column layout.
    
    In other cases we use setColumnVisibility() we don’t need to set
    a new column width either, because we store the column width ourself.
    
    Don't store column width when hiding column (new_width == 0).
    Restore column width when showing column because profiles may have
    changed the packet_list layout.
    
    Change-Id: I7e89c3477402ec6d621cd2015ee74b086f60d6cb
    Reviewed-on: https://code.wireshark.org/review/12111
    Petri-Dish: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
    

Actions performed:

    from  ff5719c   Lua: Switch URL to documentation to HTTPS
    adds  4980d50   Qt: Use correct column width when switching profile


Summary of changes:
 ui/qt/packet_list.cpp |   24 ++++++++++++++++++++----
 ui/qt/packet_list.h   |    1 +
 2 files changed, 21 insertions(+), 4 deletions(-)