From c5d015df06a4da39daad93c28ac974ec10ec0dbd Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 15 Jan 2024 10:20:07 -0800 Subject: [PATCH 1/2] Fix: Handle Deleted Files in Recent List Handle items in the Open Recent list being unavailable. Keep current overall behaviour, but show "File Not Found" on the tooltip. --- source/blender/editors/interface/interface_templates.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/interface/interface_templates.cc b/source/blender/editors/interface/interface_templates.cc index b83ca7264b8..35b1d151b22 100644 --- a/source/blender/editors/interface/interface_templates.cc +++ b/source/blender/editors/interface/interface_templates.cc @@ -7203,6 +7203,15 @@ static void uiTemplateRecentFiles_tooltip_func(bContext * /*C*/, uiTooltipData * UI_tooltip_text_field_add(tip, BLI_strdup(root), nullptr, UI_TIP_STYLE_HEADER, UI_TIP_LC_NORMAL); UI_tooltip_text_field_add(tip, nullptr, nullptr, UI_TIP_STYLE_SPACER, UI_TIP_LC_NORMAL); + if (!BLI_exists(path)) { + UI_tooltip_text_field_add(tip, + BLI_strdup(N_("File Not Found")), + nullptr, + UI_TIP_STYLE_NORMAL, + UI_TIP_LC_ALERT); + return; + } + /* Blender version. */ char version_st[128] = {0}; /* Load the thumbnail from cache if existing, but don't create if not. */ -- 2.30.2 From ec647d3fe01543873ba552a1427d5c4da06bdfff Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Mon, 15 Jan 2024 10:20:50 -0800 Subject: [PATCH 2/2] formatting change --- source/blender/editors/interface/interface_templates.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/interface/interface_templates.cc b/source/blender/editors/interface/interface_templates.cc index 35b1d151b22..a5de2f9e987 100644 --- a/source/blender/editors/interface/interface_templates.cc +++ b/source/blender/editors/interface/interface_templates.cc @@ -7204,11 +7204,8 @@ static void uiTemplateRecentFiles_tooltip_func(bContext * /*C*/, uiTooltipData * UI_tooltip_text_field_add(tip, nullptr, nullptr, UI_TIP_STYLE_SPACER, UI_TIP_LC_NORMAL); if (!BLI_exists(path)) { - UI_tooltip_text_field_add(tip, - BLI_strdup(N_("File Not Found")), - nullptr, - UI_TIP_STYLE_NORMAL, - UI_TIP_LC_ALERT); + UI_tooltip_text_field_add( + tip, BLI_strdup(N_("File Not Found")), nullptr, UI_TIP_STYLE_NORMAL, UI_TIP_LC_ALERT); return; } -- 2.30.2