Wireshark-commits: [Wireshark-commits] master-2.6 6d21086: prefs, ui: properly migrate old filter e

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 10 Sep 2018 13:39:14 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=6d21086998ab7549903215bc670ff5baf9efad9a
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master-2.6
Repository: wireshark

Commits:

6d21086 by Peter Wu (peter@xxxxxxxxxxxxx):

    prefs,ui: properly migrate old filter expressions
    
    When legacy filter expressions preferences are present, be sure to
    (1) save the dfilter_buttons file when updating the preferences file and
    (2) save the preferences file after updating the dfilter_buttons file.
    
    Without doing (1), the old buttons will be lost. Without (2), restarting
    Wireshark will result in duplicate buttons. Only write the files if the
    user actually made other changes to avoid breaking profiles by just
    opening Wireshark.
    
    Bug: 15114
    Bug: 15121
    Change-Id: I5b9417c34146c4450526781a20308c9c98fb44a1
    Reviewed-on: https://code.wireshark.org/review/29488
    Reviewed-by: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
    Petri-Dish: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    (cherry picked from commit ad0de0ffbc9ed9e397d09e1398555d06d29439d2)
     [Peter: reapplied changes to ui/qt/main_window_slots.cpp since
      ui/qt/widgets/filter_expression_toolbar.cpp is missing in 2.6 and
      applied a similar change for GTK+ as well]
    Reviewed-on: https://code.wireshark.org/review/29548
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  9bd645b   Do not use #if* in struct
     add  6d21086   prefs,ui: properly migrate old filter expressions


Summary of changes:
 epan/prefs.c                        | 17 +++++++++++++++++
 epan/prefs.h                        |  1 +
 ui/gtk/filter_expression_save_dlg.c |  7 +------
 ui/preference_utils.c               | 18 ++++++++++++++++++
 ui/preference_utils.h               |  4 ++++
 ui/qt/filter_expression_frame.cpp   |  6 +-----
 ui/qt/main_window_slots.cpp         | 14 +++-----------
 7 files changed, 45 insertions(+), 22 deletions(-)