diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-04-08 18:59:17 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-09 02:00:37 +0000 |
commit | 23a7890b6a2133a559fc691c865e617c19b26a7a (patch) | |
tree | 86c981542f9270215e1010720e4ad2280cb814d8 /ui/gtk/proto_dlg.c | |
parent | 92ebd6389203448168a2769fa473bbbad95ec159 (diff) |
Pull the code to save enabled/disabled lists into libwireshark.
It's identical in the GTK+ and Qt UIs, and it should just be done in
libwireshark.
Rename some routines to just speak of enabled_and_disabled_lists, so we
don't have to say enabled_and_disabled_protos_and_heuristic_dissectors
or something such as that.
Clean up indentation.
Change-Id: Ief2e612d9e1b60d8d0123b6bd3409dce5faf6495
Reviewed-on: https://code.wireshark.org/review/20970
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/proto_dlg.c')
-rw-r--r-- | ui/gtk/proto_dlg.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/ui/gtk/proto_dlg.c b/ui/gtk/proto_dlg.c index a9fedc305f..012e128be8 100644 --- a/ui/gtk/proto_dlg.c +++ b/ui/gtk/proto_dlg.c @@ -274,42 +274,8 @@ update_was_enabled(void) static void proto_write(gpointer parent_w _U_) { - char *pf_dir_path; - char *pf_path; - int pf_save_errno; - - /* Create the directory that holds personal configuration files, if - necessary. */ - if (create_persconffile_dir(&pf_dir_path) == -1) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Can't create directory\n\"%s\"\nfor disabled protocols file: %s.", pf_dir_path, - g_strerror(errno)); - g_free(pf_dir_path); - } else { - save_disabled_protos_list(&pf_path, &pf_save_errno); - if (pf_path != NULL) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Could not save to your disabled protocols file\n\"%s\": %s.", - pf_path, g_strerror(pf_save_errno)); - g_free(pf_path); - } - - save_enabled_protos_list(&pf_path, &pf_save_errno); - if (pf_path != NULL) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Could not save to your enabled protocols file\n\"%s\": %s.", - pf_path, g_strerror(pf_save_errno)); - g_free(pf_path); - } - - save_disabled_heur_dissector_list(&pf_path, &pf_save_errno); - if (pf_path != NULL) { - simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Could not save to your disabled heuristic protocol file\n\"%s\": %s.", - pf_path, g_strerror(pf_save_errno)); - g_free(pf_path); - } - } + /* Save the current state of the enabled/disabled lists. */ + save_enabled_and_disabled_lists(); } static void |