mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: add fspImmutable for immutable File Source (eg. search result)
This commit is contained in:
parent
de67618dd8
commit
0439ed958b
5 changed files with 24 additions and 14 deletions
|
|
@ -116,7 +116,7 @@ function TSearchResultFileSource.GetProperties: TFileSourceProperties;
|
|||
begin
|
||||
Result := inherited GetProperties;
|
||||
Result -= [fspNoneParent, fspListFlatView, fspSaveableLoadable];
|
||||
Result += [fspDontChangePath, fspDontCreateDirectory, fspSearchable];
|
||||
Result += [fspDontChangePath, fspDontCreateDirectory, fspImmutable, fspSearchable];
|
||||
if (fspDirectAccess in Result) then Result+= [fspLinksToLocalFiles];
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -132,12 +132,6 @@ var
|
|||
end;
|
||||
|
||||
begin
|
||||
params.consultResult:= fscrNotSupported;
|
||||
params.handled:= True;
|
||||
|
||||
if params.partnerFS.IsClass(TStashFileSource) then
|
||||
Exit;
|
||||
|
||||
sourceFS:= params.sourceFS;
|
||||
targetFS:= params.targetFS;
|
||||
|
||||
|
|
@ -150,12 +144,6 @@ end;
|
|||
procedure TStashFileSourceProcessor.consultMoveOperation(
|
||||
var params: TFileSourceConsultParams);
|
||||
begin
|
||||
params.consultResult:= fscrNotSupported;
|
||||
params.handled:= True;
|
||||
|
||||
if params.partnerFS.IsClass(TStashFileSource) then
|
||||
Exit;
|
||||
|
||||
if params.phase=TFileSourceConsultPhase.target then
|
||||
Exit;
|
||||
|
||||
|
|
@ -166,6 +154,15 @@ end;
|
|||
procedure TStashFileSourceProcessor.consultOperation(
|
||||
var params: TFileSourceConsultParams);
|
||||
begin
|
||||
params.consultResult:= fscrNotSupported;
|
||||
params.handled:= True;
|
||||
|
||||
if params.partnerFS.IsClass(TStashFileSource) then
|
||||
Exit;
|
||||
|
||||
if fspImmutable in params.targetFS.Properties then
|
||||
Exit;
|
||||
|
||||
case params.operationType of
|
||||
fsoCopy:
|
||||
self.consultCopyOperation( params );
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, syncobjs,
|
||||
uFileSource, uFileSourceOperationTypes, uFileSourceUtil,
|
||||
uFileSource, uFileSourceOperationTypes, uFileSourceProperty, uFileSourceUtil,
|
||||
uDebug, DCStrUtils;
|
||||
|
||||
type
|
||||
|
|
@ -272,6 +272,12 @@ end;
|
|||
|
||||
procedure TDefaultFileSourceProcessor.consultOperation( var params: TFileSourceConsultParams );
|
||||
begin
|
||||
if fspImmutable in params.targetFS.Properties then begin
|
||||
params.consultResult:= fscrNotSupported;
|
||||
params.handled:= True;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
case params.operationType of
|
||||
fsoCopy:
|
||||
self.consultCopyOperation( params );
|
||||
|
|
|
|||
|
|
@ -84,6 +84,12 @@ type
|
|||
}
|
||||
fspDontCreateDirectory,
|
||||
|
||||
{en
|
||||
Set, if the files/paths of the file source cannnot be changed
|
||||
(for example: results from searching, etc.).
|
||||
}
|
||||
fspImmutable,
|
||||
|
||||
{en
|
||||
Set, if the file source supports searching in FindDlg.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2531,6 +2531,7 @@ begin
|
|||
if not (fsoCreateDirectory in ActiveFrame.FileSource.GetOperationsTypes) then
|
||||
begin
|
||||
if (fspDontCreateDirectory in ActiveFrame.FileSource.Properties) or
|
||||
(fspImmutable in ActiveFrame.FileSource.Properties) or
|
||||
NOT (fsoCopyIn in ActiveFrame.FileSource.GetOperationsTypes) then
|
||||
begin
|
||||
msgWarning(rsMsgErrNotSupported);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue