[nautilus/gnome-3-36] file: Fallback to fast-content-type if content-type is not set
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-3-36] file: Fallback to fast-content-type if content-type is not set
- Date: Sun, 5 Apr 2020 12:20:41 +0000 (UTC)
commit 7c4750b745e12ea6a2e5d9b875688e78ce50e092
Author: Ondrej Holy <oholy redhat com>
Date: Tue Mar 31 13:55:56 2020 +0000
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
(cherry picked from commit 0e5978035b0fc87c91d7b93ed79c64d51b6d6825)
src/nautilus-file.c | 4 ++++
1 file changed, 4 insertions(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]