mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 00:09:17 +02:00
TShellTreeView: return empty string in GetPathFromNode if Node is nil (Compatible with Delphi's TShellTreeView.GetPath).
git-svn-id: trunk@48167 -
This commit is contained in:
parent
48e9a6c09a
commit
d305767d2e
@ -928,15 +928,16 @@ end;
|
||||
|
||||
function TCustomShellTreeView.GetPathFromNode(ANode: TTreeNode): string;
|
||||
begin
|
||||
Result := '';
|
||||
if ANode <> nil then // Will return the root if nothing is selected (ANode=nil)
|
||||
if Assigned(ANode) then
|
||||
begin
|
||||
Result := TShellTreeNode(ANode).FullFilename;
|
||||
if TShellTreeNode(ANode).IsDirectory then
|
||||
Result := AppendPathDelim(Result);
|
||||
end;
|
||||
if not FilenameIsAbsolute(Result) then
|
||||
Result := GetRootPath() + Result; // Include root directory
|
||||
if not FilenameIsAbsolute(Result) then
|
||||
Result := GetRootPath() + Result; // Include root directory
|
||||
end
|
||||
else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
function TCustomShellTreeView.GetSelectedNodePath: string;
|
||||
|
Loading…
Reference in New Issue
Block a user