From 7cb22cfeb09076e60a253d42484219f343853c5d Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 27 Jul 2022 06:35:04 -0700 Subject: [PATCH] [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 --- FileTree/SmartFolderNode.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FileTree/SmartFolderNode.m b/FileTree/SmartFolderNode.m index 7bc58aaec..9ace4eda5 100644 --- a/FileTree/SmartFolderNode.m +++ b/FileTree/SmartFolderNode.m @@ -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"];