diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 73a69626ee..412c1df140 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -393,7 +393,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; #define MODEL_ATTRIBUTES "standard::name,standard::type,standard::display-name," \ "standard::is-hidden,standard::is-backup,standard::size," \ - "standard::content-type,time::modified,time::access," \ + "standard::content-type,standard::fast-content-type,time::modified,time::access," \ "access::can-rename,access::can-delete,access::can-trash," \ "standard::target-uri" enum { @@ -4567,6 +4567,11 @@ get_type_information (GtkFileChooserWidget *impl, GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl); content_type = g_file_info_get_content_type (info); + if (!content_type) + content_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); + if (!content_type) + goto end; + switch (priv->type_format) { case TYPE_FORMAT_MIME: @@ -4584,6 +4589,7 @@ get_type_information (GtkFileChooserWidget *impl, g_assert_not_reached (); } +end: return g_strdup (""); } diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index e7c4bd8bbb..eeab450301 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -397,6 +397,10 @@ node_should_be_filtered_out (GtkFileSystemModel *model, guint id) if (required & GTK_FILE_FILTER_MIME_TYPE) { const char *s = g_file_info_get_content_type (node->info); + + if (!s) + s = g_file_info_get_attribute_string (node->info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); + if (s) { mime_type = g_content_type_get_mime_type (s);