TShellTreeView .GetPathPathFromNode returns invalid path
Original Reporter info from Mantis: Elphi
-
Reporter name:
Original Reporter info from Mantis: Elphi
- Reporter name:
Description:
When selecting for example the windows directory Program Files on drive C the following path is returned:
C:\Program Files.
Additional information:
function TCustomShellTreeView.GetPathFromNode(ANode: TTreeNode): string;
var
rootDir : String;
begin
// If nothing is selected, then the base is selected
if ANode = nil then Exit(GetBasePath());
// In the future use ANode.Data instead of ANode.Text
rootDir := PChar(ANode.Text);
while (ANode.Parent <> nil)do
begin
ANode := ANode.Parent;
if (PChar(ANode.Text) <> PathDelim) then <---- Last character should be tested
rootDir := PChar(ANode.Text) + PathDelim + rootDir
else
rootDir := PChar(ANode.Text) + rootDir;
end;
// Check, maybe the base path won't be necessary in the future
// if the base directory is added to the items list
Result := GetBasePath + rootDir;
end;
Mantis conversion info:
- Mantis ID: 15908
- Version: 0.9.28.3 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 23983 (#43abe1e7)
- Target version: 0.9.30