From 755932c3bc976d9a95e0b1b330efed31f7e48d9b Mon Sep 17 00:00:00 2001 From: TingPing Date: Sat, 31 Aug 2013 15:31:22 -0400 Subject: Use mimetypes for audio and images --- src/fe-gtk/gtkutil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/fe-gtk/gtkutil.c') diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index 55ae2c76..985a2f78 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -214,7 +214,7 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte if (flags & FRF_CHOOSEFOLDER) gtk_file_chooser_set_action (GTK_FILE_CHOOSER (dialog), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); - if (flags & FRF_EXTENSIONS && extensions != NULL) + if ((flags & FRF_EXTENSIONS || flags & FRF_MIMETYPES) && extensions != NULL) { filefilter = gtk_file_filter_new (); tokenbuffer = g_strdup (extensions); @@ -222,7 +222,10 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte while (token != NULL) { - gtk_file_filter_add_pattern (filefilter, token); + if (flags & FRF_EXTENSIONS) + gtk_file_filter_add_pattern (filefilter, token); + else + gtk_file_filter_add_mime_type (filefilter, token); token = strtok (NULL, ";"); } -- cgit 1.4.1