mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 13:19:21 +02:00
LCLIntf: Remove redundant IsQuoted from OpenURL (if IsFileUriWithSpaces then IsQuoted is always false).
git-svn-id: trunk@40491 -
This commit is contained in:
parent
6e06c2f634
commit
fe29021310
@ -8,7 +8,7 @@ var
|
||||
{$ELSE}
|
||||
ws: WideString;
|
||||
ans: AnsiString;
|
||||
IsFileUriWithSpaces, IsQuoted: Boolean;
|
||||
IsFileUriWithSpaces: Boolean;
|
||||
const
|
||||
FileURIScheme = 'file://';
|
||||
{$ENDIF}
|
||||
@ -29,8 +29,7 @@ begin
|
||||
//but on Win9x quoting it fails
|
||||
//Since on Windows filenames cannot contain the " character, we need not care about it and simply enclose the AURL
|
||||
IsFileUriWithSpaces := (Pos(#32,AURL) > 0) and (CompareText(Copy(AURL,1,Length(FileURIScheme)), FileURIScheme) = 0);
|
||||
IsQuoted := (Length(AURL) > 1) and (AURL[1] = '"') and (AURL[Length(AURL)] = '"');
|
||||
if IsFileUriWithSpaces and not IsQuoted then AURL := '"' + AURL + '"';
|
||||
if IsFileUriWithSpaces then AURL := '"' + AURL + '"';
|
||||
ws := UTF8Decode(AURL);
|
||||
Result := ShellExecuteW(0, nil, PWideChar(ws), nil, nil, SW_SHOWNORMAL) > 32;
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user