From c0b29fcddd6eb9c7956ff63836a71a1d90169daa Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 29 Feb 2016 13:29:19 -0800 Subject: Add a #define for the wildcard pattern that matches all files. It's *.* on Windows, but just * on UN*X; add a header that provides the definition, and use it instead of hardwiring *.*. Call the entry "All Files", that being the conventional name, rather than "Any File", whilst we're at it. Change-Id: I7c29324fc5b41e93c150e1ec67f1529f171dc6a3 Reviewed-on: https://code.wireshark.org/review/14243 Reviewed-by: Guy Harris --- ui/qt/capture_file_dialog.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'ui/qt/capture_file_dialog.cpp') diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp index 6bf27fcd03..3b659557f8 100644 --- a/ui/qt/capture_file_dialog.cpp +++ b/ui/qt/capture_file_dialog.cpp @@ -36,6 +36,7 @@ #include "../../epan/prefs.h" #include "../../wsutil/filesystem.h" #include "../../wsutil/nstime.h" +#include "ui/all_files_wildcard.h" #include @@ -344,11 +345,11 @@ QString CaptureFileDialog::fileType(int ft, bool extension_globs) extensions_list = wtap_get_file_extensions_list(ft, TRUE); if (extensions_list == NULL) { /* This file type doesn't have any particular extension - conventionally used for it, so we'll just use "*" - as the pattern, as this is UN*X, where "*.*" only - matches files that have an extension. (On Windows, - it matches all files, but this isn't Windows.) */ - filter += "*"; + conventionally used for it, so we'll just use a + wildcard that matches all file names - even those + with no extension, so we don't need to worry about + compressed file extensions. */ + filter += ALL_FILES_WILDCARD; } else { GSList *extension; /* Construct the list of patterns. */ @@ -388,10 +389,7 @@ QStringList CaptureFileDialog::buildFileOpenTypeList() { * the filter will be a bit long, so it *really* shouldn't be shown. * What about other platforms? */ - /* - * Add the "All Files" entry. As per the above, we use *, not *.*. - */ - filters << QString(tr("All Files (*)")); + filters << QString(tr("All Files (" ALL_FILES_WILDCARD ")")); /* * Add an "All Capture Files" entry, with all the extensions we -- cgit v1.2.3