diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-10-11 11:59:40 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-10-11 11:59:40 +0200 |
commit | fc963513df3946f22632f8df43baf94fed79a13e (patch) | |
tree | ab065ec04ca93e5679bb7e011a0c3b8fd3a742b9 /daemon/gvfsbackendafc.c | |
parent | e64a4cb4f5529240d292a80903de2c85dd45ff95 (diff) | |
download | gvfs-fc963513df3946f22632f8df43baf94fed79a13e.tar.gz |
afc: Don't set a content-type that isn't certain
Don't ignore the result_uncertain flag from g_content_type_guess() as it
might cause nautilus to incorrectly think that a particular file is of a
certain type, and never check its magic.
Diffstat (limited to 'daemon/gvfsbackendafc.c')
-rw-r--r-- | daemon/gvfsbackendafc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c index ce68aa45..d51b21e6 100644 --- a/daemon/gvfsbackendafc.c +++ b/daemon/gvfsbackendafc.c @@ -1593,6 +1593,7 @@ g_vfs_backend_afc_set_info_from_afcinfo (GVfsBackendAfc *self, GIcon *icon = NULL; GIcon *symbolic_icon = NULL; gchar *content_type = NULL; + gboolean uncertain_content_type = FALSE; char *display_name; char *linktarget = NULL; char **afctargetinfo = NULL; @@ -1675,11 +1676,12 @@ g_vfs_backend_afc_set_info_from_afcinfo (GVfsBackendAfc *self, } if (content_type == NULL) - content_type = g_content_type_guess (basename, NULL, 0, NULL); + content_type = g_content_type_guess (basename, NULL, 0, &uncertain_content_type); if (content_type) { - g_file_info_set_content_type (info, content_type); + if (!uncertain_content_type) + g_file_info_set_content_type (info, content_type); g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, content_type); } |