mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 16:41:26 +02:00
Opkman: Small refactoring.
git-svn-id: trunk@57341 -
This commit is contained in:
parent
38166e7a0a
commit
ab634af21c
@ -164,9 +164,8 @@ type
|
||||
destructor Destroy; override;
|
||||
procedure DownloadJSON(const ATimeOut: Integer = -1; const ASilent: Boolean = False);
|
||||
procedure DownloadPackages(const ADownloadTo: String);
|
||||
procedure CancelDownloadPackages;
|
||||
procedure UpdatePackages(const ADownloadTo: String);
|
||||
procedure CancelUpdatePackages;
|
||||
procedure Cancel;
|
||||
published
|
||||
property RemoteRepository: String read FRemoteRepository write FRemoteRepository;
|
||||
property LastError: String read FLastError write FLastError;
|
||||
@ -691,16 +690,6 @@ begin
|
||||
FDownload.DownloadPackages(ADownloadTo);
|
||||
end;
|
||||
|
||||
procedure TPackageDownloader.CancelDownloadPackages;
|
||||
begin
|
||||
if Assigned(FDownload) then
|
||||
begin
|
||||
FDownload.FHTTPClient.Terminate;
|
||||
FDownload.FTimer.StopTimer;
|
||||
FDownload.NeedToBreak := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPackageDownloader.UpdatePackages(const ADownloadTo: String);
|
||||
begin
|
||||
FDownload := TThreadDownload.Create;
|
||||
@ -712,7 +701,7 @@ begin
|
||||
FDownload.UpdatePackages(ADownloadTo);
|
||||
end;
|
||||
|
||||
procedure TPackageDownloader.CancelUpdatePackages;
|
||||
procedure TPackageDownloader.Cancel;
|
||||
begin
|
||||
if Assigned(FDownload) then
|
||||
begin
|
||||
|
@ -91,6 +91,8 @@ end;
|
||||
|
||||
destructor TOPMInterfaceEx.Destroy;
|
||||
begin
|
||||
{ if PackageDownloader.DownloadingJSON then
|
||||
PackageDownloader.Cancel;}
|
||||
FWaitForIDE.StopTimer;
|
||||
FWaitForIDE.Terminate;
|
||||
FWaitForIDE.WaitFor;
|
||||
|
@ -259,7 +259,7 @@ begin
|
||||
FSuccess := False;
|
||||
PackageDownloader.OnPackageDownloadProgress := nil;
|
||||
PackageDownloader.OnPackageDownloadError := nil;
|
||||
PackageDownloader.CancelDownloadPackages;
|
||||
PackageDownloader.Cancel;
|
||||
Close;
|
||||
end;
|
||||
end;
|
||||
@ -509,7 +509,7 @@ begin
|
||||
FSuccess := False;
|
||||
PackageDownloader.OnPackageDownloadProgress := nil;
|
||||
PackageDownloader.OnPackageDownloadError := nil;
|
||||
PackageDownloader.CancelDownloadPackages;
|
||||
PackageDownloader.Cancel;
|
||||
end;
|
||||
1: begin
|
||||
FSuccess := False;
|
||||
@ -527,7 +527,7 @@ begin
|
||||
FSuccess := False;
|
||||
PackageDownloader.OnPackageUpdateProgress := nil;
|
||||
PackageDownloader.OnPackageDownloadError := nil;
|
||||
PackageDownloader.CancelUpdatePackages;
|
||||
PackageDownloader.Cancel;
|
||||
end;
|
||||
end;
|
||||
Close;
|
||||
|
Loading…
Reference in New Issue
Block a user