Opkman: Small refactoring.

git-svn-id: trunk@57341 -
This commit is contained in:
balazs 2018-02-21 05:55:58 +00:00
parent 38166e7a0a
commit ab634af21c
3 changed files with 7 additions and 16 deletions

View File

@ -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

View File

@ -91,6 +91,8 @@ end;
destructor TOPMInterfaceEx.Destroy;
begin
{ if PackageDownloader.DownloadingJSON then
PackageDownloader.Cancel;}
FWaitForIDE.StopTimer;
FWaitForIDE.Terminate;
FWaitForIDE.WaitFor;

View File

@ -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;