caja: apply fallback patch for fast-content-type

This commit is contained in:
Ark74 2025-11-09 23:59:50 -06:00
parent d029a73fb0
commit 88e94bb6b3
2 changed files with 41 additions and 3 deletions

View file

@ -0,0 +1,34 @@
From 16145e6d4e86f0c6fc58a0e3ceec6ba16a84d900 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Tue, 31 Mar 2020 15:55:56 +0200
Subject: [PATCH] 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, 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.
---
libcaja-private/caja-file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index faa7bb50e..faea79932 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);

View file

@ -17,13 +17,17 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION=1
VERSION=2
. ./config
# Debian MATE and Ubuntu Mate both show System Tools, we don't, so we customize it.
# Debian MATE and Ubuntu Mate both show System Tools, we don't, so we
# customize it.
sed -i "s|^NoDisplay=true|#NoDisplay=true|" data/caja.desktop.in.in
changelog "Enable display caja desktop for Trisquel menu"
apply_patch_changes
changelog "Apply fallback to fast-content-type patch
Enable display caja desktop for Trisquel menu"
package