diff options
author | Ondrej Holy <oholy@redhat.com> | 2020-03-31 15:55:56 +0200 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2020-04-05 12:02:18 +0000 |
commit | 0e5978035b0fc87c91d7b93ed79c64d51b6d6825 (patch) | |
tree | bd5c229a11d727002256e46814031341d4615d59 | |
parent | 44bd77a8f178f60b5896a5dc1080c78598a9bd9d (diff) | |
download | nautilus-0e5978035b0fc87c91d7b93ed79c64d51b6d6825.tar.gz |
file: Fallback to fast-content-type if content-type is not set
The G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE attribute doesn't have to be
always set. See https://gitlab.gnome.org/GNOME/gvfs/-/merge_requests/68
for more details. In that case, Nautilus fallbacks to the
"application/octet-stream" type, which causes issues when opening the
files. Let's fallback to the "standard::fast-content-type" attribute
instead to fix issues when opening such files.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1425
-rw-r--r-- | src/nautilus-file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 45603af08..a4a7e1b21 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -2823,6 +2823,10 @@ update_info_internal (NautilusFile *file, } mime_type = g_file_info_get_content_type (info); + if (mime_type == NULL) + { + mime_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); + } if (g_strcmp0 (file->details->mime_type, mime_type) != 0) { changed = TRUE; |