mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: implement GetRealPath() in SearchResultFileSource/StashFileSource
This commit is contained in:
parent
a3b021ee76
commit
a7e860aa16
2 changed files with 35 additions and 21 deletions
|
|
@ -5,13 +5,11 @@ unit uSearchResultFileSource;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Graphics,
|
||||
uFile,
|
||||
uFileSource, uFileSourceManager,
|
||||
uMultiListFileSource,
|
||||
uFileSourceOperationTypes,
|
||||
uFileSourceOperation,
|
||||
uFileSourceProperty
|
||||
Classes, SysUtils,
|
||||
Graphics,
|
||||
uFile, uFileSource, uFileSourceManager, uMultiListFileSource,
|
||||
uFileSourceOperationTypes, uFileSourceOperation, uFileSourceProperty,
|
||||
uSysFolders
|
||||
{$IFDEF DARWIN}
|
||||
, uDarwinFile, uDarwinImage, uDCUtils
|
||||
{$ENDIF}
|
||||
|
|
@ -35,21 +33,19 @@ type
|
|||
public
|
||||
constructor Create( const displayName: String );
|
||||
|
||||
function GetProcessor: TFileSourceProcessor; override;
|
||||
|
||||
function GetRootDir(sPath : String): String; override;
|
||||
function GetProperties: TFileSourceProperties; override;
|
||||
function SetCurrentWorkingDirectory(NewDir: String): Boolean; override;
|
||||
|
||||
class function CreateFile(const APath: String): TFile; override;
|
||||
|
||||
function CreateListOperation(TargetPath: String): TFileSourceOperation; override;
|
||||
|
||||
function GetLocalName(var aFile: TFile): Boolean; override;
|
||||
function GetRootDir(sPath : String): String; override;
|
||||
function GetRealPath(const path: String): String; override;
|
||||
function SetCurrentWorkingDirectory(NewDir: String): Boolean; override;
|
||||
|
||||
function GetCustomIcon(const path: String; const iconSize: Integer): TBitmap; override; overload;
|
||||
function GetDisplayFileName(aFile: TFile): String; override;
|
||||
|
||||
function GetProcessor: TFileSourceProcessor; override;
|
||||
function GetProperties: TFileSourceProperties; override;
|
||||
class function CreateFile(const APath: String): TFile; override;
|
||||
function CreateListOperation(TargetPath: String): TFileSourceOperation; override;
|
||||
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList); override;
|
||||
end;
|
||||
|
||||
|
|
@ -108,6 +104,14 @@ begin
|
|||
Result:= PathDelim + PathDelim + PathDelim + rsSearchResult + PathDelim;
|
||||
end;
|
||||
|
||||
function TSearchResultFileSource.GetRealPath(const path: String): String;
|
||||
begin
|
||||
if self.IsPathAtRoot(path) then
|
||||
Result:= GetHomeDir
|
||||
else
|
||||
Result:= Path;
|
||||
end;
|
||||
|
||||
function TSearchResultFileSource.GetProperties: TFileSourceProperties;
|
||||
begin
|
||||
Result := inherited GetProperties;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ uses
|
|||
uFile, uFileProperty, uFileSourceManager,
|
||||
uFileSourceProperty, uFileSourceOperation, uFileSourceOperationTypes,
|
||||
uFileSource, uVirtualFileSource, uFileSystemFileSource, uVfsModule,
|
||||
uFileSourceUtil, uDCUtils,
|
||||
uFileSourceUtil, uDCUtils, uSysFolders,
|
||||
uStashFilesBackend
|
||||
{$IFDEF DARWIN}
|
||||
, uDarwinImage
|
||||
|
|
@ -46,14 +46,16 @@ type
|
|||
class function GetFileSource: IFileSource; override;
|
||||
|
||||
function GetLocalName(var aFile: TFile): Boolean; override;
|
||||
function GetRootDir(sPath : String): String; override;
|
||||
function GetRealPath(const path: String): String; override;
|
||||
class function IsSupportedPath(const Path: String): Boolean; override;
|
||||
|
||||
class function GetMainIcon(out Path: String): Boolean; override;
|
||||
function GetCustomIcon(const path: String; const iconSize: Integer): TBitmap; override; overload;
|
||||
function GetDisplayFileName(aFile: TFile): String; override;
|
||||
function needReload(const PathToReload: String; const PathToCheck: String): Boolean; override;
|
||||
function QueryContextMenu(AFiles: TFiles; var AMenu: TPopupMenu): Boolean; override;
|
||||
|
||||
function GetProcessor: TFileSourceProcessor; override;
|
||||
function GetRootDir(sPath : String): String; override;
|
||||
class function IsSupportedPath(const Path: String): Boolean; override;
|
||||
function GetProperties: TFileSourceProperties; override;
|
||||
function GetSupportedFileProperties: TFilePropertiesTypes; override;
|
||||
function GetRetrievableFileProperties: TFilePropertiesTypes; override;
|
||||
|
|
@ -71,7 +73,7 @@ type
|
|||
function CreateSetFilePropertyOperation(var theTargetFiles: TFiles; var theNewProperties: TFileProperties): TFileSourceOperation; override;
|
||||
function CreateExecuteOperation(var ExecutableFile: TFile; BasePath, Verb: String): TFileSourceOperation; override;
|
||||
|
||||
function QueryContextMenu(AFiles: TFiles; var AMenu: TPopupMenu): Boolean; override;
|
||||
function needReload(const PathToReload: String; const PathToCheck: String): Boolean; override;
|
||||
procedure AddSearchPath( const startPath: String; paths: TStringList); override;
|
||||
end;
|
||||
|
||||
|
|
@ -276,6 +278,14 @@ begin
|
|||
Result:= PathDelim + STASH_NAME + PathDelim;
|
||||
end;
|
||||
|
||||
function TStashFileSource.GetRealPath(const path: String): String;
|
||||
begin
|
||||
if self.IsPathAtRoot(path) then
|
||||
Result:= GetHomeDir
|
||||
else
|
||||
Result:= Path;
|
||||
end;
|
||||
|
||||
class function TStashFileSource.IsSupportedPath(const Path: String): Boolean;
|
||||
begin
|
||||
Result:= Path.StartsWith( STASH_SCHEME );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue