summary refs log tree commit diff stats
path: root/src/fe-gtk/gtkutil.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-08-31 15:31:22 -0400
committerTingPing <tingping@tingping.se>2013-08-31 15:31:22 -0400
commit755932c3bc976d9a95e0b1b330efed31f7e48d9b (patch)
tree46168e7629f6a4cb772474d67ef60d2f781940d7 /src/fe-gtk/gtkutil.c
parent4c406bce171db7086e394f69ae3cddd3b4dc8a87 (diff)
Use mimetypes for audio and images
Diffstat (limited to 'src/fe-gtk/gtkutil.c')
-rw-r--r--src/fe-gtk/gtkutil.c7
1 files changed, 5 insertions, 2 deletions
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, ";");
 		}