[gtk+/filesystemmodel: 5/28] handle the case where there is no content type available
- From: Benjamin Otte <otte src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+/filesystemmodel: 5/28] handle the case where there is no content type available
- Date: Tue, 23 Jun 2009 16:17:16 -0400 (EDT)
commit 40d9a5705d03a3a69c24baad3a1ead3eed0353b9
Author: Benjamin Otte <otte gnome org>
Date: Thu Jun 18 19:55:56 2009 +0200
handle the case where there is no content type available
gtk/gtkfilechooserdefault.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 0895bd6..cedd452 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -6013,6 +6013,7 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
GtkFileFilterInfo filter_info;
GtkFileFilterFlags needed;
gboolean result;
+ const char *s;
if (!impl->current_filter)
return FALSE;
@@ -6022,7 +6023,11 @@ get_is_file_filtered (GtkFileChooserDefault *impl,
needed = gtk_file_filter_get_needed (impl->current_filter);
filter_info.display_name = g_file_info_get_display_name (file_info);
- filter_info.mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
+ s = g_file_info_get_content_type (file_info);
+ if (s)
+ filter_info.mime_type = g_content_type_get_mime_type (s);
+ else
+ filter_info.mime_type = NULL;
if (needed & GTK_FILE_FILTER_FILENAME)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]