summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystemmodel.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-02-28 16:59:19 +0100
committerBastien Nocera <hadess@hadess.net>2020-02-28 17:33:08 +0100
commit8cb45cdeae7ae981447d80368a4f5a433f3c2d36 (patch)
tree93f4dac2cb74d988b4d445ca0011d243743ea643 /gtk/gtkfilesystemmodel.c
parent823714cf66c887886fb58a21c016f0d58acb1047 (diff)
downloadgtk+-8cb45cdeae7ae981447d80368a4f5a433f3c2d36.tar.gz
filechooser: Fallback if content-type unavailable
Fallback to fast-content-type if the content-type attribute isn't available, as is the case for most remote filesystems. Closes: #2482
Diffstat (limited to 'gtk/gtkfilesystemmodel.c')
-rw-r--r--gtk/gtkfilesystemmodel.c4
1 files changed, 4 insertions, 0 deletions
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);