mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: TFileSystemWatcher.Features function
(cherry picked from commit 24838d18f3)
This commit is contained in:
parent
5436c7c574
commit
f96767c13d
2 changed files with 15 additions and 2 deletions
|
|
@ -235,7 +235,8 @@ uses
|
|||
LCLIntf, LCLProc, LazUTF8, Forms, Dialogs, Buttons, DCOSUtils, DCStrUtils,
|
||||
fMain, uShowMsg, uLng, uFileProperty, uFileSource, uFileSourceOperationTypes,
|
||||
uGlobs, uInfoToolTip, uDisplayFile, uFileSystemFileSource, uFileSourceUtil,
|
||||
uArchiveFileSourceUtil, uFormCommands, uKeyboard, uFileSourceSetFilePropertyOperation;
|
||||
uArchiveFileSourceUtil, uFormCommands, uKeyboard, uFileSourceSetFilePropertyOperation,
|
||||
uFileSystemWatcher;
|
||||
|
||||
type
|
||||
TControlHandlersHack = class(TWinControl)
|
||||
|
|
@ -353,7 +354,7 @@ begin
|
|||
begin
|
||||
// FRenameFile is nil when a file list
|
||||
// already updated by the real 'rename' event
|
||||
if FlatView and Assigned(FRenameFile) then
|
||||
if FlatView and Assigned(FRenameFile) and (TFileSystemWatcher.Features * [fsfFlatView] = []) then
|
||||
begin
|
||||
PushRenameEvent(FRenameFile, NewFileName);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ type
|
|||
fswUnknownChange);
|
||||
TFSWatcherEventTypes = set of TFSWatcherEventType;
|
||||
|
||||
TFSFeatures = set of (fsfFlatView);
|
||||
|
||||
TFSWatcherEventData = record
|
||||
Path: String;
|
||||
EventType: TFSWatcherEventType;
|
||||
|
|
@ -82,6 +84,7 @@ type
|
|||
{$ENDIF}
|
||||
class function CanWatch(const WatchPaths: array of String): Boolean;
|
||||
class function AvailableWatchFilter: TFSWatchFilter;
|
||||
class function Features: TFSFeatures;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
|
@ -388,6 +391,15 @@ begin
|
|||
];
|
||||
end;
|
||||
|
||||
class function TFileSystemWatcher.Features: TFSFeatures;
|
||||
begin
|
||||
Result := [
|
||||
{$IF DEFINED(DARWIN)}
|
||||
fsfFlatView
|
||||
{$ENDIF}
|
||||
];
|
||||
end;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
procedure ShowError(const sErrMsg: String);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue