mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Open bookmark files which links to directory (issue #2211)
This commit is contained in:
parent
fd6d5a8085
commit
2bc4832f21
2 changed files with 22 additions and 0 deletions
|
|
@ -215,6 +215,15 @@ begin
|
|||
if LowerCase(ExtractOnlyFileExt(FileName)) = 'lnk' then
|
||||
Result:= SHFileIsLinkToFolder(FileName, LinkTarget);
|
||||
end;
|
||||
{$ELSEIF DEFINED(DARWIN)}
|
||||
begin
|
||||
LinkTarget:= ResolveAliasFile(FileName);
|
||||
if mbCompareFileNames(FileName, LinkTarget) then
|
||||
Result:= False
|
||||
else begin
|
||||
Result:= mbDirectoryExists(LinkTarget);
|
||||
end;
|
||||
end;
|
||||
{$ELSEIF DEFINED(UNIX)}
|
||||
begin
|
||||
Result:= False;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ function MountNetworkDrive(const serverAddress: String): Boolean;
|
|||
|
||||
function GetVolumeName(const Device: String): String;
|
||||
|
||||
function ResolveAliasFile(const FileName: String): String;
|
||||
|
||||
procedure openSystemSecurityPreferences_PrivacyAllFiles;
|
||||
|
||||
function unmountAndEject(const path: String): Boolean;
|
||||
|
|
@ -633,6 +635,17 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function ResolveAliasFile(const FileName: String): String;
|
||||
var
|
||||
ASource: NSURL;
|
||||
ATarget: NSURL;
|
||||
begin
|
||||
Result:= EmptyStr;
|
||||
ASource:= NSURL.fileURLWithPath(StringToNSString(FileName));
|
||||
ATarget:= NSURL(NSURL.URLByResolvingAliasFileAtURL_options_error(ASource, NSURLBookmarkResolutionWithoutUI, nil));
|
||||
if Assigned(ATarget) then Result:= ATarget.fileSystemRepresentation;
|
||||
end;
|
||||
|
||||
procedure openSystemSecurityPreferences_PrivacyAllFiles;
|
||||
const
|
||||
Privacy_AllFiles = 'x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue