aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-11-18 14:10:00 -0800
committerGuy Harris <guy@alum.mit.edu>2018-11-18 22:10:42 +0000
commitbf9286e554c8d2b9e506b62dc7c0ed8f6e830160 (patch)
tree7057b13cf88f642626c5cc0272a52d0a389d3c61 /ui
parent189f1ceec25f4900e25b6faea5f15aeb27a08c7e (diff)
Add an API to get the file extension for a compression type, and use it.
Add wtap_compressed_file_extension(), which returns NULL for WTAP_UNCOMPRESSED and the appropriate file extension for other compression types. Add wtap_compression_type_supported(), which returns TRUE for WTAP_UNCOMPRESSED and all supported compression types and FALSE otherwise. ("Supported" means "the code can decompmress files in that compression format and can write files in that compression format", so WTAP_GAIP_COMPRESSED is supported iff libwiretap is built with zlib.) In MainWindow::fileAddExtension, instead of checking for WTAP_GZIP_COMPRESSED and using ".gz" as the extension, use the extension returned by wtap_compressed_file_extension() for the compression type. Change-Id: I47cb0eca8c887ada3562df30b54e76509008180f Reviewed-on: https://code.wireshark.org/review/30707 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/main_window.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index aba97e09a1..635afaecaa 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -1665,7 +1665,7 @@ void MainWindow::fileAddExtension(QString &file_name, int file_type, wtap_compre
/* Get the extension for the compression type we'll be using, or
NULL if we won't be compressing it. */
compressed_file_extension =
- (compression_type == WTAP_UNCOMPRESSED) ? NULL : "gz";
+ (compression_type == WTAP_UNCOMPRESSED) ? NULL : wtap_compressed_file_extension(compression_type);
if (extensions_list != NULL) {
GSList *extension;