mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
parent
0ab5113eca
commit
7bc216b8b1
2 changed files with 26 additions and 35 deletions
|
|
@ -189,7 +189,6 @@ type
|
|||
It is called from GUI thread.
|
||||
}
|
||||
procedure DoUpdateFile;
|
||||
procedure DoAbortFile;
|
||||
|
||||
protected
|
||||
procedure Execute; override;
|
||||
|
|
@ -203,6 +202,7 @@ type
|
|||
ABreakFileMethod: TAbortFileMethod;
|
||||
var AFileList: TFVWorkerFileList); reintroduce;
|
||||
destructor Destroy; override;
|
||||
procedure Abort; override;
|
||||
end;
|
||||
|
||||
{ TCalculateSpaceWorker }
|
||||
|
|
@ -893,6 +893,16 @@ begin
|
|||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TFilePropertiesRetriever.Abort;
|
||||
begin
|
||||
inherited Abort;
|
||||
|
||||
if Assigned(FAbortFileMethod) then
|
||||
begin
|
||||
FAbortFileMethod(FIndex, FFileList.FUserData);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFilePropertiesRetriever.Execute;
|
||||
var
|
||||
HaveIcons: Boolean;
|
||||
|
|
@ -904,10 +914,8 @@ begin
|
|||
begin
|
||||
DirectAccess := not IsInPathList(gIconsExcludeDirs, FFileList.Files[0].FSFile.Path);
|
||||
end;
|
||||
while FIndex < FFileList.Count do
|
||||
while (FIndex < FFileList.Count) and (Aborted = False) do
|
||||
begin
|
||||
if Aborted then
|
||||
Break;
|
||||
|
||||
try
|
||||
FWorkingFile := FFileList.Files[FIndex];
|
||||
|
|
@ -937,9 +945,6 @@ begin
|
|||
{$ENDIF}
|
||||
end;
|
||||
|
||||
if Aborted then
|
||||
Break;
|
||||
|
||||
TThread.Synchronize(Thread, @DoUpdateFile);
|
||||
|
||||
except
|
||||
|
|
@ -948,23 +953,14 @@ begin
|
|||
end;
|
||||
Inc(FIndex);
|
||||
end;
|
||||
if Aborted and Assigned(FAbortFileMethod) then
|
||||
begin
|
||||
TThread.Synchronize(Thread, @DoAbortFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFilePropertiesRetriever.DoUpdateFile;
|
||||
begin
|
||||
if not Aborted and Assigned(FUpdateFileMethod) then
|
||||
if Assigned(FUpdateFileMethod) then
|
||||
FUpdateFileMethod(FWorkingFile, FWorkingUserData);
|
||||
end;
|
||||
|
||||
procedure TFilePropertiesRetriever.DoAbortFile;
|
||||
begin
|
||||
FAbortFileMethod(FIndex, FFileList.FUserData);
|
||||
end;
|
||||
|
||||
{ TCalculateSpaceWorker }
|
||||
|
||||
constructor TCalculateSpaceWorker.Create(AFileSource: IFileSource;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ type
|
|||
It is called from GUI thread.
|
||||
}
|
||||
procedure DoUpdateFile;
|
||||
procedure DoAbortFile;
|
||||
|
||||
protected
|
||||
procedure Execute; override;
|
||||
|
|
@ -44,6 +43,7 @@ type
|
|||
AThumbnailManager: TThumbnailManager;
|
||||
var AFileList: TFVWorkerFileList); reintroduce;
|
||||
destructor Destroy; override;
|
||||
procedure Abort; override;
|
||||
end;
|
||||
|
||||
TThumbFileView = class;
|
||||
|
|
@ -111,24 +111,16 @@ uses
|
|||
|
||||
procedure TFileThumbnailsRetriever.DoUpdateFile;
|
||||
begin
|
||||
if not Aborted and Assigned(FUpdateFileMethod) then
|
||||
if Assigned(FUpdateFileMethod) then
|
||||
FUpdateFileMethod(FWorkingFile, FWorkingUserData);
|
||||
end;
|
||||
|
||||
procedure TFileThumbnailsRetriever.DoAbortFile;
|
||||
begin
|
||||
FAbortFileMethod(FIndex, FFileList.UserData);
|
||||
end;
|
||||
|
||||
procedure TFileThumbnailsRetriever.Execute;
|
||||
var
|
||||
Bitmap: TBitmap;
|
||||
begin
|
||||
while FIndex < FFileList.Count do
|
||||
while (FIndex < FFileList.Count) and (Aborted = False) do
|
||||
begin
|
||||
if Aborted then
|
||||
Break;
|
||||
|
||||
FWorkingFile := FFileList.Files[FIndex];
|
||||
FWorkingUserData := FFileList.Data[FIndex];
|
||||
|
||||
|
|
@ -142,9 +134,6 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
if Aborted then
|
||||
Break;
|
||||
|
||||
TThread.Synchronize(Thread, @DoUpdateFile);
|
||||
|
||||
except
|
||||
|
|
@ -152,10 +141,6 @@ begin
|
|||
end;
|
||||
Inc(FIndex);
|
||||
end;
|
||||
if Aborted and Assigned(FAbortFileMethod) then
|
||||
begin
|
||||
TThread.Synchronize(Thread, @DoAbortFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TFileThumbnailsRetriever.Create(AFileSource: IFileSource;
|
||||
|
|
@ -181,6 +166,16 @@ begin
|
|||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TFileThumbnailsRetriever.Abort;
|
||||
begin
|
||||
inherited Abort;
|
||||
|
||||
if Assigned(FAbortFileMethod) then
|
||||
begin
|
||||
FAbortFileMethod(FIndex, FFileList.UserData);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TThumbDrawGrid }
|
||||
|
||||
procedure TThumbDrawGrid.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue