LCL: Eliminate a variable in function DoOpen for Mac.

This commit is contained in:
Juha 2025-02-02 10:23:41 +02:00
parent 4164e5b669
commit d8227cc4c4

View File

@ -1,8 +1,6 @@
{%MainUnit ../lclintf.pas} {%MainUnit ../lclintf.pas}
function DoOpen(APath: String; Param: String): Boolean; function DoOpen(APath: String; Param: String): Boolean;
var
ResultingPath: string;
begin begin
Result := True; Result := True;
if not FileExistsUTF8(APath) and not DirectoryExistsUTF8(Apath) then begin if not FileExistsUTF8(APath) and not DirectoryExistsUTF8(Apath) then begin
@ -12,14 +10,12 @@ begin
end; end;
// Paths with spaces need to be quoted, see bug 21651 // Paths with spaces need to be quoted, see bug 21651
if (APath<>'') and (APath[1]<>'''') then if (APath<>'') and (APath[1]<>'''') then
ResultingPath:=QuotedStr(APath) APath:=QuotedStr(APath);
else
ResultingPath:=APath;
if Param<>'' then if Param<>'' then
ResultingPath:=Param+' '+ResultingPath; APath:=Param+' '+APath;
RunCmdFromPath('open',ResultingPath); RunCmdFromPath('open',APath);
end; end;
function FindDefaultBrowser(out ABrowser, AParams: String): Boolean; function FindDefaultBrowser(out ABrowser, AParams: String): Boolean;