From 1b2d06b80d2fa5e8b31ebcbcb030d560a6fabbb1 Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Mon, 12 Feb 2024 18:45:41 +0100 Subject: [PATCH] TShellTreeView: fix crash if ObjectTypes is changed at runtime. Issue #40766. --- lcl/shellctrls.pas | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 889ac22650..7e7658ed05 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -674,9 +674,10 @@ begin CurrPath := GetPath; try BeginUpdate; - Refresh(nil); - if Exists(CurrPath) then - SetPath(CurrPath); + //Refresh(nil); + //if Exists(CurrPath) then + // SetPath(CurrPath); + UpdateView; finally EndUpdate; end; @@ -1393,7 +1394,12 @@ begin if not (otNonFolders in FObjectTypes) then Result := ((Attr and faDirectory) > 0) else - Result := True; + begin + if not (otHidden in FObjectTypes) then + Result := ((Attr and faHidden) = 0) + else + Result := True; + end; {$ifdef debug_shellctrls} debugln(['TCustomShellTreeView.SetPath.Exists: Result = ',Result]); {$endif}