mirror of
https://github.com/CloudDelphi/Virtual-File-System
synced 2025-12-19 09:53:54 +01:00
Fixed bug: DisableVfsForThisThread made VFS control API to fail
This commit is contained in:
parent
d67a8ae4f9
commit
7cb8c94406
20
VfsBase.pas
20
VfsBase.pas
@ -343,9 +343,8 @@ end;
|
||||
|
||||
function RunVfs (DirListingOrder: TDirListingSortType): boolean;
|
||||
begin
|
||||
result := not DisableVfsForThisThread;
|
||||
result := true;
|
||||
|
||||
if result then begin
|
||||
with VfsCritSection do begin
|
||||
Enter;
|
||||
|
||||
@ -362,27 +361,23 @@ begin
|
||||
|
||||
Leave;
|
||||
end; // .with
|
||||
end; // .if
|
||||
end; // .function RunVfs
|
||||
|
||||
function PauseVfs: LONGBOOL; stdcall;
|
||||
begin
|
||||
result := not DisableVfsForThisThread;
|
||||
result := true;
|
||||
|
||||
if result then begin
|
||||
with VfsCritSection do begin
|
||||
Enter;
|
||||
VfsIsRunning := false;
|
||||
Leave;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function ResetVfs: LONGBOOL; stdcall;
|
||||
begin
|
||||
result := not DisableVfsForThisThread;
|
||||
result := true;
|
||||
|
||||
if result then begin
|
||||
with VfsCritSection do begin
|
||||
Enter;
|
||||
VfsItems.Clear;
|
||||
@ -392,7 +387,6 @@ begin
|
||||
VfsTreeIsBuilt := false;
|
||||
Leave;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function IsVfsActive: boolean;
|
||||
@ -631,9 +625,6 @@ var
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
result := not DisableVfsForThisThread;
|
||||
|
||||
if result then begin
|
||||
with VfsCritSection do begin
|
||||
Enter;
|
||||
result := VfsTreeIsBuilt;
|
||||
@ -661,7 +652,6 @@ begin
|
||||
|
||||
Leave;
|
||||
end; // .with
|
||||
end; // .if
|
||||
end; // .function RefreshVfs
|
||||
|
||||
function RefreshMappedFile (const FilePath: WideString): boolean;
|
||||
@ -674,9 +664,6 @@ var
|
||||
begin
|
||||
VfsItem := nil;
|
||||
// * * * * * //
|
||||
result := not DisableVfsForThisThread;
|
||||
|
||||
if result then begin
|
||||
with VfsCritSection do begin
|
||||
Enter;
|
||||
result := VfsTreeIsBuilt;
|
||||
@ -697,7 +684,6 @@ begin
|
||||
|
||||
Leave;
|
||||
end; // .with
|
||||
end; // .if
|
||||
end; // .function RefreshMappedFile
|
||||
|
||||
begin
|
||||
|
||||
@ -10,7 +10,7 @@ unit VfsWatching;
|
||||
uses
|
||||
Windows, SysUtils, Math,
|
||||
Utils, Concur, WinUtils, StrLib, WinNative,
|
||||
VfsBase, VfsUtils, {FIXME} DlgMes;
|
||||
VfsBase, VfsUtils;
|
||||
|
||||
|
||||
(* Spawns separate thread, which starts recursive monitoring for changes in specified directory.
|
||||
@ -253,7 +253,6 @@ begin
|
||||
if NeedFullRescan and (PlannedRescanTime <= CurrentTime) then begin
|
||||
VfsBase.RefreshVfs;
|
||||
NeedFullRescan := false;
|
||||
VarDump(['Fully rescanned']);
|
||||
end;
|
||||
|
||||
if DirChangesScanner = nil then begin
|
||||
@ -283,7 +282,6 @@ begin
|
||||
end else if DirChange.Action = NOTIFY_FILE_MODIFIED then begin
|
||||
if not NeedFullRescan then begin
|
||||
VfsBase.RefreshMappedFile(DirChange.FilePath);
|
||||
VarDump(['Updated ' + DirChange.FilePath]);
|
||||
end;
|
||||
|
||||
LastChangeTime := WinUtils.GetMicroTime;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user