diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-04-01 21:17:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-04-01 21:17:50 +0000 |
commit | b1ecd8d217502b6223ffed2ea0d0edabb5a9f81f (patch) | |
tree | 26c9b757d7e493fc8a2bc455062bdae3db75df34 /ui/gtk/capture_file_dlg.c | |
parent | 82a602d697b03314a11b3fd914dc7173fe18b293 (diff) |
Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types. Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.
Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it. Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.
svn path=/trunk/; revision=48690
Diffstat (limited to 'ui/gtk/capture_file_dlg.c')
-rw-r--r-- | ui/gtk/capture_file_dlg.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c index 573057d6d8..cabbd712e3 100644 --- a/ui/gtk/capture_file_dlg.c +++ b/ui/gtk/capture_file_dlg.c @@ -1291,7 +1291,6 @@ static check_savability_t check_save_with_comments(capture_file *cf) { guint32 comment_types; - GArray *savable_file_types; GtkWidget *msg_dialog; gint response; @@ -1307,11 +1306,7 @@ check_save_with_comments(capture_file *cf) /* No. Are there formats in which we can write this file that supports all the comments in this file? */ - savable_file_types = wtap_get_savable_file_types(cf->cd_t, cf->linktypes, - comment_types); - if (savable_file_types != NULL) { - g_array_free(savable_file_types, TRUE); - + if (wtap_dump_can_write(cf->linktypes, comment_types)) { /* Yes. Offer the user a choice of "Save in a format that supports comments", "Discard comments and save in the file's own format", or "Cancel", meaning "don't bother @@ -1577,7 +1572,6 @@ static check_savability_t gtk_check_save_as_with_comments(GtkWidget *w, capture_file *cf, int file_type) { guint32 comment_types; - GArray *savable_file_types; GtkWidget *msg_dialog; gint response; @@ -1593,11 +1587,7 @@ gtk_check_save_as_with_comments(GtkWidget *w, capture_file *cf, int file_type) /* No. Are there formats in which we can write this file that supports all the comments in this file? */ - savable_file_types = wtap_get_savable_file_types(file_type, cf->linktypes, - comment_types); - if (savable_file_types != NULL) { - g_array_free(savable_file_types, TRUE); - + if (wtap_dump_can_write(cf->linktypes, comment_types)) { /* Yes. Offer the user a choice of "Save in a format that supports comments", "Discard comments and save in the format you selected", or "Cancel", meaning "don't bother |