ADD/StashFS: step-20: forbid creating directories

This commit is contained in:
rich2014 2026-06-06 10:21:22 +08:00
commit c007bfa8e8
4 changed files with 12 additions and 5 deletions

View file

@ -112,7 +112,7 @@ function TSearchResultFileSource.GetProperties: TFileSourceProperties;
begin
Result := inherited GetProperties;
Result -= [fspNoneParent, fspListFlatView];
Result += [fspDontChangePath, fspSearchable];
Result += [fspDontChangePath, fspDontCreateDirectory, fspSearchable];
if (fspDirectAccess in Result) then Result+= [fspLinksToLocalFiles];
end;

View file

@ -279,7 +279,7 @@ end;
function TStashFileSource.GetProperties: TFileSourceProperties;
begin
Result:= _fileSystemFS.Properties;
Result+= [fspLinksToLocalFiles, fspDontChangePath];
Result+= [fspLinksToLocalFiles, fspDontChangePath, fspDontCreateDirectory];
end;
function TStashFileSource.GetSupportedFileProperties: TFilePropertiesTypes;

View file

@ -78,6 +78,12 @@ type
}
fspDontChangePath,
{en
Set, if creating directories is forbidden.
DC should not use workarounds to create directories.
}
fspDontCreateDirectory,
{en
Set, if the file source supports searching in FindDlg.
}

View file

@ -2509,12 +2509,13 @@ begin
try
if not (fsoCreateDirectory in ActiveFrame.FileSource.GetOperationsTypes) then
begin
if (fsoCopyIn in ActiveFrame.FileSource.GetOperationsTypes) then
bMakeViaCopy := True
else begin
if (fspDontCreateDirectory in ActiveFrame.FileSource.Properties) or
NOT (fsoCopyIn in ActiveFrame.FileSource.GetOperationsTypes) then
begin
msgWarning(rsMsgErrNotSupported);
Exit;
end;
bMakeViaCopy := True
end;
ActiveFile := ActiveFrame.CloneActiveFile;