mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 18:49:30 +02:00
LCL help: URL handling with parameters, add firefox to the browserlist, specific location for Safari, added htlmview for Feora/Suse from Colin Western
git-svn-id: trunk@9788 -
This commit is contained in:
parent
309004eb24
commit
3deada2b99
@ -43,7 +43,7 @@
|
||||
<Unit1>
|
||||
<Filename Value="main.pp"/>
|
||||
<UnitName Value="Main"/>
|
||||
<CursorPos X="29" Y="3655"/>
|
||||
<CursorPos X="20" Y="3656"/>
|
||||
<TopLine Value="3628"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<UsageCount Value="19"/>
|
||||
@ -226,32 +226,7 @@
|
||||
<Loaded Value="True"/>
|
||||
</Unit23>
|
||||
</Units>
|
||||
<JumpHistory Count="6" HistoryIndex="5">
|
||||
<Position1>
|
||||
<Filename Value="main.pp"/>
|
||||
<Caret Line="3650" Column="12" TopLine="3628"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="../lcl/defaulttranslator.pas"/>
|
||||
<Caret Line="1" Column="1" TopLine="1"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="main.pp"/>
|
||||
<Caret Line="3653" Column="33" TopLine="3624"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="main.pp"/>
|
||||
<Caret Line="1027" Column="5" TopLine="1002"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="idetranslations.pas"/>
|
||||
<Caret Line="67" Column="11" TopLine="42"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="main.pp"/>
|
||||
<Caret Line="3653" Column="9" TopLine="3628"/>
|
||||
</Position6>
|
||||
</JumpHistory>
|
||||
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
|
@ -416,10 +416,16 @@ begin
|
||||
end;
|
||||
if FDefaultBrowser='' then begin
|
||||
// Then search in path. Prefer open source ;)
|
||||
if Find('mozilla')
|
||||
if Find('htmlview')
|
||||
or Find('firefox')
|
||||
or Find('mozilla')
|
||||
or Find('galeon')
|
||||
or Find('konqueror')
|
||||
or Find('safari')
|
||||
{$IFDEF DARWIN}
|
||||
{ safari is not on path for MacOS }
|
||||
or Find('/Applications/Safari.app/Contents/MacOS/Safari')
|
||||
{$ENDIF}
|
||||
or Find('netscape')
|
||||
or Find('opera')
|
||||
or Find('iexplore') then ;
|
||||
|
@ -651,20 +651,20 @@ begin
|
||||
// skip the '//' after the colon
|
||||
if (URLStartPos<=len) and (URL[URLStartPos]='/') then inc(URLStartPos);
|
||||
if (URLStartPos<=len) and (URL[URLStartPos]='/') then inc(URLStartPos);
|
||||
// search param delimiter ?
|
||||
// search for param delimiter (?) or anchor delimiter (#)
|
||||
ParamStartPos:=ColonPos+1;
|
||||
while (ParamStartPos<=len) and (URL[ParamStartPos]<>'?') do
|
||||
while (ParamStartPos<=len) and not (URL[ParamStartPos]in ['?', '#']) do
|
||||
inc(ParamStartPos);
|
||||
// get URLPath and URLParams
|
||||
URLPath:=copy(URL,URLStartPos,ParamStartPos-URLStartPos);
|
||||
URLParams:=copy(URL,ParamStartPos+1,len-ParamStartPos);
|
||||
URLParams:=copy(URL,ParamStartPos,len-ParamStartPos+1);
|
||||
end;
|
||||
|
||||
function CombineURL(const URLType, URLPath, URLParams: string): string;
|
||||
begin
|
||||
Result:=URLType+'://'+URLPath;
|
||||
if URLParams<>'' then
|
||||
Result:=Result+'?'+URLParams;
|
||||
Result:=Result+URLParams;
|
||||
end;
|
||||
|
||||
function URLFilenameIsAbsolute(const Filename: string): boolean;
|
||||
@ -698,7 +698,7 @@ var
|
||||
begin
|
||||
Result:=1;
|
||||
Len:=length(URL);
|
||||
while (Result<=Len) and (URL[Result]<>'?') do inc(Result);
|
||||
while (Result<=Len) and not (URL[Result] in ['?','#']) do inc(Result);
|
||||
end;
|
||||
|
||||
function ChompURLParams(const URL: string): string;
|
||||
@ -715,7 +715,9 @@ begin
|
||||
PathStart:=FindURLPathStart(URL);
|
||||
if PathStart<1 then exit;
|
||||
p:=FindURLPathEnd(URL);
|
||||
while (p>0) and (URL[p]<>'/') do dec(p);
|
||||
repeat
|
||||
dec(p);
|
||||
until (p<=0) or (URL[p]='/');
|
||||
if p<=PathStart then exit;
|
||||
Result:=copy(URL,1,p);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user