mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: fspSearchable to TFileSourceProperties, and appy in TMainCommands.cm_Search()
This commit is contained in:
parent
b1426fd06d
commit
98533a9d15
5 changed files with 12 additions and 9 deletions
|
|
@ -823,7 +823,7 @@ end;
|
|||
function TFileSystemFileSource.GetProperties: TFileSourceProperties;
|
||||
begin
|
||||
Result := [
|
||||
fspDirectAccess, fspListFlatView, fspNoneParent
|
||||
fspDirectAccess, fspListFlatView, fspNoneParent, fspSearchable
|
||||
{$IFDEF UNIX}
|
||||
, fspCaseSensitive
|
||||
{$ENDIF}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ function TSearchResultFileSource.GetProperties: TFileSourceProperties;
|
|||
begin
|
||||
Result := inherited GetProperties - [fspNoneParent, fspListFlatView];
|
||||
if (fspDirectAccess in Result) then Result+= [fspLinksToLocalFiles];
|
||||
Include(Result, fspSearchable);
|
||||
end;
|
||||
|
||||
function TSearchResultFileSource.SetCurrentWorkingDirectory(NewDir: String): Boolean;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,11 @@ type
|
|||
{en
|
||||
Set, if the file source supports custom file icons.
|
||||
}
|
||||
fspCustomIcon
|
||||
fspCustomIcon,
|
||||
{en
|
||||
Set, if the file source supports searching in FindDlg.
|
||||
}
|
||||
fspSearchable
|
||||
);
|
||||
|
||||
TFileSourceProperties = set of TFileSourceProperty;
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ end;
|
|||
|
||||
function TWcxArchiveFileSource.GetProperties: TFileSourceProperties;
|
||||
begin
|
||||
Result := [fspUsesConnections, fspListFlatView];
|
||||
Result := [fspUsesConnections, fspListFlatView, fspSearchable];
|
||||
end;
|
||||
|
||||
function TWcxArchiveFileSource.GetSupportedFileProperties: TFilePropertiesTypes;
|
||||
|
|
|
|||
|
|
@ -3545,19 +3545,17 @@ procedure TMainCommands.cm_Search(const Params: array of string);
|
|||
var
|
||||
TemplateName: String;
|
||||
begin
|
||||
if not (frmMain.ActiveFrame.FileSource.IsClass(TFileSystemFileSource) or
|
||||
frmMain.ActiveFrame.FileSource.IsClass(TWcxArchiveFileSource) or
|
||||
frmMain.ActiveFrame.FileSource.IsClass(TSearchResultFileSource) ) then
|
||||
if fspSearchable in frmMain.ActiveFrame.FileSource.GetProperties then
|
||||
begin
|
||||
msgError(rsMsgErrNotSupported)
|
||||
end
|
||||
else begin
|
||||
if Length(Params) > 0 then
|
||||
TemplateName:= Params[0]
|
||||
else begin
|
||||
TemplateName:= gSearchDefaultTemplate;
|
||||
end;
|
||||
ShowFindDlg(frmMain.ActiveFrame, TemplateName);
|
||||
end
|
||||
else begin
|
||||
msgError(rsMsgErrNotSupported)
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue