mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: TDarwinApplicationUtil.hasFullDiskAccess() on macOS
This commit is contained in:
parent
98533a9d15
commit
05c1e0e6bb
1 changed files with 17 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, Menus, uLng,
|
||||
BaseUnix,
|
||||
MacOSAll, CocoaAll,
|
||||
CocoaPrivate, CocoaApplication, CocoaEvent, CocoaThemes, CocoaMenus,
|
||||
CocoaUtils, CocoaConst, Cocoa_Extra,
|
||||
|
|
@ -54,6 +55,7 @@ type
|
|||
class procedure openWithDefaultApp( const filePath: String );
|
||||
class procedure performService( const serviceName: String );
|
||||
class procedure openSystemSecurityPreferences_PrivacyAllFiles;
|
||||
class function hasFullDiskAccess: Boolean;
|
||||
public
|
||||
class procedure installFNKeyTap;
|
||||
class procedure uninstallFNKeyTap;
|
||||
|
|
@ -264,6 +266,21 @@ begin
|
|||
NSWorkspace.sharedWorkspace.openURL( url );
|
||||
end;
|
||||
|
||||
class function TDarwinApplicationUtil.hasFullDiskAccess: Boolean;
|
||||
const
|
||||
testFile = '/Library/Application Support/com.apple.TCC/TCC.db';
|
||||
var
|
||||
fd: cInt;
|
||||
begin
|
||||
fd:= fpopen( pchar(testFile), O_RDONLY );
|
||||
if fd = -1 then begin
|
||||
Result:= False;
|
||||
end else begin
|
||||
fpclose( fd );
|
||||
Result:= True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDarwinServiceMenuManager.attachSystemMenu(Sender: TObject);
|
||||
begin
|
||||
self.attachServicesMenu( Sender );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue