mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD #2675: improve searching in subpath in iCloud Drive
This commit is contained in:
parent
a971639d45
commit
900342d648
4 changed files with 18 additions and 8 deletions
|
|
@ -543,7 +543,8 @@ begin
|
|||
FreeAndNil(ASelectedFiles);
|
||||
end;
|
||||
|
||||
(FileView.FileSource as ILocalFileSource).AddSearchPath( FSelectedFiles );
|
||||
(FileView.FileSource as ILocalFileSource).AddSearchPath(
|
||||
FileView.CurrentRealPath, FSelectedFiles );
|
||||
|
||||
FindInArchive(FileView);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ type
|
|||
|
||||
ILocalFileSource = interface(IRealFileSource)
|
||||
['{22F03840-42C2-0E62-2CCE-677794F64598}']
|
||||
procedure AddSearchPath( paths: TStringList );
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList );
|
||||
end;
|
||||
|
||||
{en
|
||||
|
|
@ -24,14 +24,14 @@ type
|
|||
{ TLocalFileSource }
|
||||
|
||||
TLocalFileSource = class(TRealFileSource, ILocalFileSource)
|
||||
procedure AddSearchPath( paths: TStringList ); virtual;
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList ); virtual;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TLocalFileSource }
|
||||
|
||||
procedure TLocalFileSource.AddSearchPath( paths: TStringList );
|
||||
procedure TLocalFileSource.AddSearchPath( const startPath: String; paths: TStringList );
|
||||
begin
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ type
|
|||
function GetDisplayFileName(aFile: TFile): String; override;
|
||||
function QueryContextMenu(AFiles: TFiles; var AMenu: TPopupMenu): Boolean; override;
|
||||
|
||||
procedure AddSearchPath( paths: TStringList); override;
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
|
@ -806,11 +806,20 @@ begin
|
|||
Result:= True;
|
||||
end;
|
||||
|
||||
procedure TiCloudDriveFileSource.AddSearchPath( paths: TStringList );
|
||||
procedure TiCloudDriveFileSource.AddSearchPath( const startPath: String; paths: TStringList );
|
||||
var
|
||||
iCloudDrivePath: String;
|
||||
iCloudBasePath: String;
|
||||
begin
|
||||
if paths.Count > 0 then
|
||||
Exit;
|
||||
paths.Add( uDCUtils.ReplaceTilde(iCloudDriveConfig.path.base) );
|
||||
|
||||
iCloudDrivePath:= uDCUtils.ReplaceTilde( iCloudDriveConfig.path.drive );
|
||||
if ExcludeTrailingPathDelimiter(startPath) <> iCloudDrivePath then
|
||||
Exit;
|
||||
|
||||
iCloudBasePath:= uDCUtils.ReplaceTilde( iCloudDriveConfig.path.base );
|
||||
paths.Add( iCloudBasePath );
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ uses
|
|||
Classes, SysUtils, fpjson, Dialogs,
|
||||
uGlobsPaths, DCJsonConfig, DCOSUtils;
|
||||
|
||||
|
||||
type
|
||||
|
||||
TiCloudDriveConfigPath = record
|
||||
base: String;
|
||||
drive: String;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue