mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD/StashFS: step-17: support search in Stash
This commit is contained in:
parent
09c3f0de70
commit
744a272ba7
2 changed files with 18 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ end;
|
|||
|
||||
function TSearchResultFileSource.GetRootDir(sPath: String): String;
|
||||
begin
|
||||
Result:= PathDelim + PathDelim + PathDelim + rsSearchResult + PathDelim;
|
||||
Result:= PathDelim + PathDelim + PathDelim + rsSearchResult + PathDelim;
|
||||
end;
|
||||
|
||||
function TSearchResultFileSource.GetProperties: TFileSourceProperties;
|
||||
|
|
@ -175,7 +175,7 @@ var
|
|||
begin
|
||||
if paths.Count > 0 then
|
||||
Exit;
|
||||
files:= self.GetFiles( self.GetRootDir(EmptyStr) );
|
||||
files:= self.GetFiles( self.GetRootDir );
|
||||
for i:= 0 to files.Count-1 do
|
||||
paths.Add( files[i].FullPath );
|
||||
files.Free;
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ type
|
|||
function CreateSetFilePropertyOperation(var theTargetFiles: TFiles; var theNewProperties: TFileProperties): TFileSourceOperation; override;
|
||||
|
||||
function QueryContextMenu(AFiles: TFiles; var AMenu: TPopupMenu): Boolean; override;
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
|
@ -412,6 +413,21 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TStashFileSource.AddSearchPath(
|
||||
const startPath: String;
|
||||
paths: TStringList );
|
||||
var
|
||||
files: TFiles;
|
||||
i: Integer;
|
||||
begin
|
||||
if paths.Count > 0 then
|
||||
Exit;
|
||||
files:= self.GetFiles( self.GetRootDir );
|
||||
for i:= 0 to files.Count-1 do
|
||||
paths.Add( files[i].FullPath );
|
||||
files.Free;
|
||||
end;
|
||||
|
||||
initialization
|
||||
stashFileSourceProcessor:= TStashFileSourceProcessor.Create;
|
||||
RegisterVirtualFileSource( STASH_NAME, STASH_SCHEME, TStashFileSource, True );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue