From 1e00a918d111c6db30d461490f68adfbaec4b3f8 Mon Sep 17 00:00:00 2001 From: aaronp64 Date: Thu, 2 May 2024 13:05:53 -0400 Subject: [PATCH] Fix FileSystemDock thumbnails sometimes not displaying There were (at least) three cases where thumbnails would not display, if they were generated while the FileSystemDock was not visible: - current_path == "Favorites", due to p_path not starting with "Favorites" - current_path == "res://", due to current_path having last "/" trimmed for comparison - current_path pointing to a selected file instead of folder, since it no longer matches p_path's base directory This change removes the current_path and is_visible_in_tree checks when determining whether to update the file's icon. Fixes #90801 Fixes #91432 --- editor/filesystem_dock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 4c7c723dd5c7..2da36bfc22b2 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -776,7 +776,7 @@ void FileSystemDock::navigate_to_path(const String &p_path) { } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref &p_preview, const Ref &p_small_preview, const Variant &p_udata) { - if ((file_list_vb->is_visible_in_tree() || current_path.trim_suffix("/") == p_path.get_base_dir()) && p_preview.is_valid()) { + if (p_preview.is_valid()) { Array uarr = p_udata; int idx = uarr[0]; String file = uarr[1];