From 6e8c897e21707bb321dad80023c2a95cff7c9d0c Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Mon, 31 Oct 2022 01:08:12 +0100 Subject: [PATCH] Tracker: Always use thumb attr when there is one ... even when the "Generate image thumbnails" setting is off. This allows applications to generate thumbnails for 'non-media' files. For example I use this in the ACE Amstrad CPC Emulator, to add a thumbnail to emulator savestates (snapshots) with a screen capture of the machine. Change-Id: I95b0e4c64f5b1ffa779512755f70cfd9c1881661 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5768 Reviewed-by: John Scipione Reviewed-by: nephele Tested-by: Commit checker robot --- src/kits/tracker/Model.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/Model.cpp b/src/kits/tracker/Model.cpp index 8a96c32d99..f68d6e0101 100644 --- a/src/kits/tracker/Model.cpp +++ b/src/kits/tracker/Model.cpp @@ -620,8 +620,11 @@ Model::FinishSettingUpType() else if (strcmp(type, kVirtualDirectoryMimeType) == 0) fBaseType = kVirtualDirectoryNode; - if (ShouldGenerateThumbnail(type)) + attr_info thumb; + if (fNode->GetAttrInfo(kAttrThumbnail, &thumb) == B_OK + || ShouldGenerateThumbnail(type)) { fIconFrom = kNode; + } if (info.GetPreferredApp(type) == B_OK) { if (fPreferredAppName)