diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-05 13:51:42 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-05 14:34:33 -0400 |
commit | 644d522d19f91ff52a39a1477f3aa9c0dd07fe4c (patch) | |
tree | c21a1737147c03869ac77915dc245b9a9955178f /tests/testfilechooser.c | |
parent | a8b0125da1ba47742f21f734070d2d1cfc9cf46d (diff) | |
download | gtk+-644d522d19f91ff52a39a1477f3aa9c0dd07fe4c.tar.gz |
filefilter: Drop custom filters
These don't work with native file choosers.
Diffstat (limited to 'tests/testfilechooser.c')
-rw-r--r-- | tests/testfilechooser.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 4ff2c8ca96..d3378d472a 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -118,21 +118,6 @@ response_cb (GtkDialog *dialog, g_main_context_wakeup (NULL); } -static gboolean -no_backup_files_filter (GFileInfo *info, - gpointer data) -{ - const char *display_name; - gsize len; - - display_name = g_file_info_get_display_name (info); - len = strlen (display_name); - if (len > 0 && display_name[len - 1] == '~') - return 0; - else - return 1; -} - static void filter_changed (GtkFileChooserDialog *dialog, gpointer data) @@ -400,14 +385,6 @@ main (int argc, char **argv) g_object_unref (filter); filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, "No backup files"); - gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_DISPLAY_NAME, - no_backup_files_filter, NULL, NULL); - gtk_file_filter_add_mime_type (filter, "image/png"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - g_object_unref (filter); - - filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Starts with D"); gtk_file_filter_add_pattern (filter, "D*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); |