diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-02-20 13:44:27 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-02-20 23:16:54 +0000 |
commit | ead79e6aa15210cf83032698d7d17eb54a3d0857 (patch) | |
tree | 99484c25885f5c277f8cb4b2a54d7fac2534b51a /epan/filter_expressions.h | |
parent | 422ad100aad4c076ab05f1373dad59481ea12072 (diff) | |
download | wireshark-ead79e6aa15210cf83032698d7d17eb54a3d0857.tar.gz |
Clear the filter expression list in prefs.c.
Move filter_expression_nuke from ui/gtk to epan and rename it to
filter_expression_free. Call it in prefs_reset along with the other
preference reset routines.
This keeps the Qt filter toolbar from filling up with duplicate
expressions when the profile changes.
Change-Id: I9fae9a7b48944079ea342a126979d9e79af0d22b
Reviewed-on: https://code.wireshark.org/review/7281
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 'epan/filter_expressions.h')
-rw-r--r-- | epan/filter_expressions.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/epan/filter_expressions.h b/epan/filter_expressions.h index 84d5fe9d7d..fa2ec7790d 100644 --- a/epan/filter_expressions.h +++ b/epan/filter_expressions.h @@ -29,6 +29,10 @@ extern "C" { #endif /* __cplusplus */ +/** @file + * Filter expressions. + */ + struct filter_expression { gpointer button; /* Filter toolbar */ gchar *label; @@ -43,12 +47,25 @@ struct filter_expression { WS_DLL_PUBLIC struct filter_expression **pfilter_expression_head; +/** Create a filter expression + * + * @param label Label (button) text for the expression. + * @param expr The display filter for the expression. + * @param enabled Determines if the expression is shown in the UI. + * @return A newly allocated and initialized struct filter_expression. + */ WS_DLL_PUBLIC struct filter_expression *filter_expression_new(const gchar *label, const gchar *expr, const gboolean enabled); void filter_expression_init(gboolean prefs); +/** Clear the filter expression list. + * Frees each item in the list. Caller should set list_head to NULL afterward. + */ +WS_DLL_PUBLIC +void filter_expression_free(struct filter_expression *list_head); + #ifdef __cplusplus } #endif /* __cplusplus */ |