aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_file_dialog.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-28 18:14:01 -0800
committerGuy Harris <guy@alum.mit.edu>2016-02-29 02:50:07 +0000
commit5f5e9da18bbc58148c73d545dc0aa792d5dcc55e (patch)
tree2ee96c002a9359b6aa1458055c61d6d40709cdbb /ui/qt/capture_file_dialog.cpp
parent289ca20fe1e80ee140434f682e85ab64054e17c6 (diff)
Use *, not *.*, as the wildcard pattern on UN*X.
On Windows, the pattern that matches all files is *.*; *, by itself, doesn't work, as I remember. UN*Xes take the pattern a bit more literally, so if it has a dot in it, it has to match a dot. Bug: 12203 Change-Id: I11518c29c4ffd73485bad6e49b6dd9cc16bbd0b0 Reviewed-on: https://code.wireshark.org/review/14233 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/capture_file_dialog.cpp')
-rw-r--r--ui/qt/capture_file_dialog.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp
index ff4399dc78..6bf27fcd03 100644
--- a/ui/qt/capture_file_dialog.cpp
+++ b/ui/qt/capture_file_dialog.cpp
@@ -218,6 +218,7 @@ int CaptureFileDialog::exec() {
// Windows
+// We use native file dialogs here, rather than the Qt dialog
#ifdef Q_OS_WIN
int CaptureFileDialog::selectedFileType() {
return file_type_;
@@ -295,6 +296,8 @@ int CaptureFileDialog::mergeType() {
}
#else // not Q_OS_WINDOWS
+// Not Windows
+// We use the Qt dialogs here
QString CaptureFileDialog::fileExtensionType(int et, bool extension_globs)
{
QString filter;
@@ -341,13 +344,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; on Windows, that matches all file names
- - even those with no extension - so we don't need to
- worry about compressed file extensions. (It does not
- do so on UN*X; the right pattern on UN*X would just
- be "*".) */
- filter += "*.*";
+ 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 += "*";
} else {
GSList *extension;
/* Construct the list of patterns. */
@@ -387,8 +388,10 @@ 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. */
- filters << QString(tr("All Files (*.*)"));
+ /*
+ * Add the "All Files" entry. As per the above, we use *, not *.*.
+ */
+ filters << QString(tr("All Files (*)"));
/*
* Add an "All Capture Files" entry, with all the extensions we