[gnac/devel] Better filtering of input files
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Better filtering of input files
- Date: Mon, 13 Dec 2010 03:24:57 +0000 (UTC)
commit 286d9009f248e6b1f7554a70aa8b9a01cae41b2b
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Thu Dec 9 15:23:58 2010 -0500
Better filtering of input files
src/gnac-main.c | 19 ++++++++++---------
src/gnac-ui.c | 1 +
2 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 6554487..4d95c77 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -288,10 +288,10 @@ gnac_add_files(GSList *files)
void
gnac_add_file(GFile *file)
{
+ const gchar *mime_type;
gchar *uri;
GError *error = NULL;
GFileInfo *info;
- GtkFileFilterInfo filter_info;
uri = g_file_get_uri(file);
libgnac_debug("Trying to add file %s", uri);
@@ -307,17 +307,18 @@ gnac_add_file(GFile *file)
return;
}
- filter_info.contains = GTK_FILE_FILTER_MIME_TYPE;
- filter_info.mime_type = g_file_info_get_content_type(info);
+ mime_type = g_file_info_get_content_type(info);
- if (filter_info.mime_type) {
+ if (mime_type) {
/* Check whether we have a playlist */
- if (gnac_playlist_is_mime_playlist(filter_info.mime_type)) {
- gnac_playlist_parse(file, filter_info.mime_type);
+ if (gnac_playlist_is_mime_playlist(mime_type)) {
+ gnac_playlist_parse(file, mime_type);
/* Check whether the file format is supported */
- /* FIXME this should be done in libgnac with gstreamer */
- } else if (gtk_file_filter_filter(gnac_ui_get_default_filter(),
- &filter_info))
+ } else if (g_str_has_prefix(mime_type, "audio/") ||
+ g_str_has_prefix(mime_type, "video/") ||
+ g_str_equal(mime_type, "application/ogg") ||
+ g_str_equal(mime_type, "application/vnd.rn-realmedia") ||
+ g_str_equal(mime_type, "application/x-shockwave-flash"))
{
libgnac_info("Add file %s", uri);
libgnac_converter_add(converter, file, &error);
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 62a0055..ee6719b 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -195,6 +195,7 @@ gnac_ui_file_chooser_get_filters_model(void)
{ "video/x-matroska" , _("Matroska video") },
{ "video/mpeg" , _("MPEG video") },
{ "video/mp4" , _("MPEG-4 video") },
+ { "application/ogg" , _("Ogg multimedia file") },
{ "video/ogg" , _("Ogg video") },
{ "video/quicktime" , _("QuickTime video") },
{ "application/vnd.rn-realmedia" , _("RealMedia document") },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]