diff --git a/src/nautilus-file-private.h b/src/nautilus-file-private.h index d5d26c8b396cb625e7dd123bdcca98393b416f3b..e9d49530c706c98b4e74dd6ee1ba8494c5d41578 100644 --- a/src/nautilus-file-private.h +++ b/src/nautilus-file-private.h @@ -27,7 +27,7 @@ #include "nautilus-file-undo-operations.h" #define NAUTILUS_FILE_DEFAULT_ATTRIBUTES \ - "standard::*,access::*,mountable::*,time::*,unix::*,owner::*,selinux::*,thumbnail::*,id::filesystem,trash::orig-path,trash::deletion-date,metadata::*,recent::*" + "standard::*,access::*,mountable::*,time::*,unix::*,owner::*,selinux::*,thumbnail::*,id::filesystem,trash::orig-path,trash::deletion-date,metadata::*,recent::*,preview::icon" /* These are in the typical sort order. Known things come first, then * things where we can't know, finally things where we don't yet know. @@ -185,6 +185,7 @@ struct NautilusFileDetails guint start_stop_type : 3; /* GDriveStartStopType */ guint can_poll_for_media : 1; guint is_media_check_automatic : 1; + guint has_preview_icon : 1; guint filesystem_readonly : 1; guint filesystem_use_preview : 2; /* GFilesystemPreviewType */ diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 2999f2fa5beaa24c2e648ffaf3e5985a36eb51bf..d9d988ccdd488e08057cb0c116761e39b4eacf26 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -2914,6 +2914,11 @@ update_info_internal (NautilusFile *file, file->details->trash_orig_path = g_strdup (trash_orig_path); } + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_PREVIEW_ICON)) + { + file->details->has_preview_icon = TRUE; + } + changed |= nautilus_file_update_metadata_from_info (file, info); @@ -4836,6 +4841,15 @@ nautilus_file_should_show_thumbnail (NautilusFile *file) return FALSE; } + if (show_file_thumbs != NAUTILUS_SPEED_TRADEOFF_NEVER && + file->details->has_preview_icon) + { + /* The thumbnail should be generated if the preview icon is available + * regardless of the filesystem type (i.e. for MTP/GPhoto2 backends). + */ + return TRUE; + } + return get_speed_tradeoff_preference_for_file (file, show_file_thumbs); }