diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-22 18:12:45 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-22 18:23:05 (GMT) |
commit | 5c5d5cf6f70155d0920d8727696785d8348d65fb (patch) | |
tree | 9066cbfba15bba8096822aed9cfacf7cfd1b35da /src/gui | |
parent | b250e23a418f991bb979158e119bdb78cddc8228 (diff) | |
download | Qt-5c5d5cf6f70155d0920d8727696785d8348d65fb.zip Qt-5c5d5cf6f70155d0920d8727696785d8348d65fb.tar.gz Qt-5c5d5cf6f70155d0920d8727696785d8348d65fb.tar.bz2 |
Show filter extensions in the GTK file dialog if no name is provided
In the GTK+ file dialog filters are only represented by names such as
"All files", while the actual extensions are hidden.
You can create a filter without a name in Qt however so in this case
we have to fall back to showing the file extensions instead.
Task-number: 251928
Reviewed-by: rosch
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/gtksymbols.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index acb8437..0842ec7 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -746,9 +746,9 @@ static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent, foreach (const QString &rawfilter, filters) { GtkFileFilter *gtkFilter = QGtk::gtk_file_filter_new (); QString name = rawfilter.left(rawfilter.indexOf(QLatin1Char('('))); - QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name)); - QStringList extensions = extract_filter(rawfilter); + QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name.isEmpty() ? extensions.join(QLS(", ")) : name)); + foreach (const QString &fileExtension, extensions) { QGtk::gtk_file_filter_add_pattern (gtkFilter, qPrintable(fileExtension)); } |