ShellTreeView: change the logic of showing an expandsign so that the same logic of r47650 #cb26c9b482 is applied wether or not [otHidden] is specified.

git-svn-id: trunk@47686 -
This commit is contained in:
bart 2015-02-10 18:39:20 +00:00
parent 7a1e890dab
commit 81193487b6

View File

@ -662,18 +662,30 @@ var
var var
SR: TSearchRec; SR: TSearchRec;
FindRes: LongInt; FindRes: LongInt;
Attr: Longint;
IsHidden: Boolean;
begin begin
Result:=False; Result:=False;
try try
FindRes := FindFirstUTF8(AppendPathDelim(ADir) + AllFilesMask, faDirectory, SR); Attr := faDirectory;
if (otHidden in fObjectTypes) then Attr := Attr or faHidden;
FindRes := FindFirstUTF8(AppendPathDelim(ADir) + AllFilesMask, Attr , SR);
while (FindRes = 0) do while (FindRes = 0) do
begin begin
if ((SR.Attr and faDirectory <> 0) and (SR.Name <> '.') and if ((SR.Attr and faDirectory <> 0) and (SR.Name <> '.') and
(SR.Name <> '..')) then (SR.Name <> '..')) then
begin
IsHidden := ((Attr and faHidden) > 0);
{$IFDEF Unix}
if (SR.Name<>'') and (SR.Name[1]='.') then
IsHidden := True;
{$ENDIF}
if not (IsHidden and (not ((otHidden in fObjectTypes)))) then
begin begin
Result := True; Result := True;
Break; Break;
end; end;
end;
FindRes := FindNextUtf8(SR); FindRes := FindNextUtf8(SR);
end; end;
finally finally
@ -695,7 +707,7 @@ begin
begin begin
NewNode := Items.AddChildObject(ANode, Files.Strings[i], nil); //@Files.Strings[i]); NewNode := Items.AddChildObject(ANode, Files.Strings[i], nil); //@Files.Strings[i]);
// This marks if the node is a directory // This marks if the node is a directory
if (fObjectTypes = [otFolders]) then if (fObjectTypes * [otNonFolders] = []) then
NewNode.HasChildren := ((Files.Objects[i] <> nil) and NewNode.HasChildren := ((Files.Objects[i] <> nil) and
HasSubDir(AppendpathDelim(ANodePath)+Files[i])) HasSubDir(AppendpathDelim(ANodePath)+Files[i]))
else else