diff options
author | Ondrej Holy <oholy@redhat.com> | 2023-03-08 15:27:24 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2023-03-29 13:49:46 +0000 |
commit | cbd4c1d95e7f8ef7847c39fd28c66fbbaa25f941 (patch) | |
tree | 4a9c427dc95111b896b77600880f5b1595111e61 /src/nautilus-directory-async.c | |
parent | fa27862d0c5f5d641a52f0b83812ac3d08c1cc7b (diff) | |
download | nautilus-cbd4c1d95e7f8ef7847c39fd28c66fbbaa25f941.tar.gz |
Add fast-content-type fallback to all places
The `G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE` attribute doesn't have to
be always set. The commit 0e597803 added the
`G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE` fallback inside the
`NautilusFile` class, but not for other places. Let's fix this oversight.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2862
Diffstat (limited to 'src/nautilus-directory-async.c')
-rw-r--r-- | src/nautilus-directory-async.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nautilus-directory-async.c b/src/nautilus-directory-async.c index 7436a6949..c3738565a 100644 --- a/src/nautilus-directory-async.c +++ b/src/nautilus-directory-async.c @@ -1008,6 +1008,12 @@ dequeue_pending_idle_callback (gpointer callback_data) /* Add the MIME type to the set. */ mimetype = g_file_info_get_attribute_string (file_info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); + if (mimetype == NULL) + { + mimetype = g_file_info_get_attribute_string (file_info, + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); + } + if (mimetype != NULL) { istr_set_insert (dir_load_state->load_mime_list_hash, @@ -3266,6 +3272,12 @@ mime_list_one (MimeListState *state, mime_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE); + if (mime_type == NULL) + { + mime_type = g_file_info_get_attribute_string (info, + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE); + } + if (mime_type != NULL) { istr_set_insert (state->mime_list_hash, mime_type); @@ -3444,7 +3456,8 @@ mime_list_start (NautilusDirectory *directory, } g_file_enumerate_children_async (location, - G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," + G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, 0, /* flags */ G_PRIORITY_LOW, /* prio */ state->cancellable, |