summaryrefslogtreecommitdiff
path: root/ui/gtk/filter_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-09 02:01:05 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-09 17:57:52 +0000
commit7d5ce06cbe35f3f818695c87e5b0f42172ee3784 (patch)
treeb1819216afd831302cc94af54187122a2efdd4d8 /ui/gtk/filter_dlg.c
parent1abbb503e4242f56921b7ee950f185711e9f85c0 (diff)
downloadwireshark-7d5ce06cbe35f3f818695c87e5b0f42172ee3784.tar.gz
Pull the error reporting into {read,save}_filter_list.
Change-Id: I4d9582661f2f1728d400eeb2a1b1dea98f32ce7f Reviewed-on: https://code.wireshark.org/review/20982 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/filter_dlg.c')
-rw-r--r--ui/gtk/filter_dlg.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/ui/gtk/filter_dlg.c b/ui/gtk/filter_dlg.c
index 7604f078e7..cf699d8467 100644
--- a/ui/gtk/filter_dlg.c
+++ b/ui/gtk/filter_dlg.c
@@ -798,49 +798,24 @@ filter_apply(GtkWidget *main_w, gboolean destroy)
static void
filter_dlg_save(filter_list_type_t list_type)
{
- char *pf_dir_path;
- char *f_path;
- int f_save_errno;
- const char *filter_type;
-
switch (list_type) {
case CFILTER_EDITED_LIST:
- filter_type = "capture";
- list_type = CFILTER_LIST;
- copy_filter_list(CFILTER_LIST, CFILTER_EDITED_LIST);
+ list_type = CFILTER_LIST;
+ copy_filter_list(CFILTER_LIST, CFILTER_EDITED_LIST);
break;
case DFILTER_EDITED_LIST:
- filter_type = "display";
- list_type = DFILTER_LIST;
- copy_filter_list(DFILTER_LIST, DFILTER_EDITED_LIST);
+ list_type = DFILTER_LIST;
+ copy_filter_list(DFILTER_LIST, DFILTER_EDITED_LIST);
break;
default:
g_assert_not_reached();
- filter_type = NULL;
break;
}
- /* 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 filter files: %s.",
- pf_dir_path, g_strerror(errno));
- g_free(pf_dir_path);
- return;
- }
-
- save_filter_list(list_type, &f_path, &f_save_errno);
- if (f_path != NULL) {
- /* We had an error saving the filter. */
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- "Could not save to your %s filter file\n\"%s\": %s.",
- filter_type, f_path, g_strerror(f_save_errno));
- g_free(f_path);
- }
+ save_filter_list(list_type);
}