[File Tree] Ask Sandbox for access to Smart Folder

Ask for access to Smart Folder dictionary file, to read its query.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
main
Christopher Snowhill 2022-07-27 06:35:04 -07:00
parent a2dacc067b
commit 9113051840
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,8 @@
#import "Logging.h"
#import "SandboxBroker.h"
@implementation SmartFolderNode
- (BOOL)isLeaf {
@ -20,7 +22,9 @@
}
- (void)updatePath {
const void *sbHandle = [[SandboxBroker sharedSandboxBroker] beginFolderAccess:url];
NSDictionary *doc = [NSDictionary dictionaryWithContentsOfFile:[url path]];
[[SandboxBroker sharedSandboxBroker] endFolderAccess:sbHandle];
NSString *rawQuery = [doc objectForKey:@"RawQuery"];
NSArray *searchPaths = [[doc objectForKey:@"SearchCriteria"] objectForKey:@"CurrentFolderPath"];