Add a wtap_dump_can_write() routine that indicates whether Wiretap
[metze/wireshark/wip.git] / ui / qt / capture_file_dialog.cpp
index 2e2a992263ef8b7d19556a8e7a622f24da0be4d8..a62d0ad9c3ea9eaf6c05dd3739687d11b8ce045a 100644 (file)
@@ -136,7 +136,6 @@ check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *
     return win32_check_save_as_with_comments(parent->effectiveWinId(), cf, file_type);
 #else // Q_WS_WIN
     guint32 comment_types;
-    GArray *savable_file_types;
     QMessageBox msg_dialog;
     int response;
 
@@ -152,11 +151,7 @@ check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *
 
     /* 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)) {
         QPushButton *default_button;
         /* Yes.  Offer the user a choice of "Save in a format that
            supports comments", "Discard comments and save in the