diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 16b8f3693e..9a1693f3aa 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -70,7 +70,6 @@ type { Other methods specific to Lazarus } function PopulateTreeNodeWithFiles( ANode: TTreeNode; ANodePath: string): Boolean; - procedure PopulateWithBaseFiles; procedure DoSelectionChanged; override; function CanExpand(Node: TTreeNode): Boolean; override; public @@ -86,6 +85,7 @@ type { Other methods specific to Lazarus } function GetPathFromNode(ANode: TTreeNode): string; function GetSelectedNodePath: string; deprecated 'Use property Path instead'; + procedure PopulateWithBaseFiles; procedure Refresh(ANode: TTreeNode); overload; { Properties } @@ -859,6 +859,7 @@ var begin // avoids crashes in the IDE by not populating during design if (csDesigning in ComponentState) then Exit; + Items.Clear; r := GetLogicalDriveStrings(SizeOf(Drives), Drives); if r = 0 then Exit; @@ -884,6 +885,7 @@ begin // avoids crashes in the IDE by not populating during design // also do not populate before loading is done if ([csDesigning, csLoading] * ComponentState <> []) then Exit; + Items.Clear; // This allows showing "/" in Linux, but in Windows it makes no sense to show the base if GetBasePath() <> '' then