diff options
author | Ondrej Holy <[email protected]> | 2020-03-31 15:55:56 +0200 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2025-07-24 07:39:29 -0400 |
commit | 2d3666e41d4d5d8a82bfb0181b05b2af78595bc6 (patch) | |
tree | e45c4a6baf3b68f827e2155be6330b5722cb84ea /libcaja-private | |
parent | d6f4c970f9aec18aefad196cf24c5d432cd5bec8 (diff) | |
download | caja-master.tar.bz2 caja-master.tar.xz |
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, Caja 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.
Imported from Nautilus commit: https://gitlab.gnome.org/GNOME/nautilus/-/commit/0e5978035b0fc87c91d7b93ed79c64d51b6d6825
Fixes #1840.
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index faa7bb50..faea7993 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -2460,6 +2460,9 @@ update_info_internal (CajaFile *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 (eel_strcmp (file->details->mime_type, mime_type) != 0) { changed = TRUE; g_clear_pointer (&file->details->mime_type, g_ref_string_release); |