LazMapViewer: Fix compilation with FPC 3.2

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6835 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-03-22 23:15:55 +00:00
parent 9f7de9f224
commit 0c3c974b0e
3 changed files with 23 additions and 13 deletions

View File

@ -36,16 +36,24 @@ type
{ TMVDEFPC }
TMVDEFPC = class(TMvCustomDownloadEngine)
{$IF FPC_FullVersion >= 30101}
private
FUseProxy: Boolean;
FProxyHost: string;
FProxyPort: Word;
FProxyUserName: String;
FProxyPassWord: String;
{$IFEND}
public
procedure DownloadFile(const Url: string; AStream: TStream); override;
{$IF FPC_FullVersion >= 30101}
published
property UseProxy;
property ProxyHost;
property ProxyPort;
property ProxyUsername;
property ProxyPassword;
{$ENDIF}
property UseProxy: Boolean read FUseProxy write FUseProxy default false;
property ProxyHost: String read FProxyHost write FProxyHost;
property ProxyPort: Word read FProxyPort write FProxyPort;
property ProxyUsername: String read FProxyUserName write FProxyUserName;
property ProxyPassword: String read FProxyPassword write FProxyPassword;
{$IFEND}
end;
@ -63,14 +71,16 @@ begin
inherited;
http := TFpHttpClient.Create(nil);
try
{$IF FPC_FullVersion >= 30000}
http.AllowRedirect := true;
{$IFEND}
http.AddHeader('User-Agent','Mozilla/5.0 (compatible; fpweb)');
{$IF FPC_FullVersion >= 30101}
if UseProxy then begin
http.Proxy.Host := ProxyHost;
http.Proxy.Port := ProxyPort;
http.Proxy.UserName := ProxyUserName;
http.Proxy.Password := ProxyPassword;
http.Proxy.Host := FProxyHost;
http.Proxy.Port := FProxyPort;
http.Proxy.UserName := FProxyUserName;
http.Proxy.Password := FProxyPassword;
end;
{$ENDIF}
http.Get(Url, AStream);