[Sandbox] Handle file tree path config better
Handle the configuration better, by adding the path to the grants list if it is newly configured. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
f5bde75eda
commit
3ef6a4204f
|
@ -20,6 +20,8 @@
|
|||
}
|
||||
|
||||
- (void)updatePath {
|
||||
if(!url) return;
|
||||
|
||||
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url
|
||||
includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey]
|
||||
options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles)
|
||||
|
|
|
@ -74,7 +74,7 @@ static NSURL *defaultMusicDirectory(void) {
|
|||
DLog(@"File tree root URL: %@\n", url);
|
||||
NSURL *newURL = [NSURL URLWithString:url];
|
||||
if((!self.rootURL || ![self.rootURL isEqualTo:newURL]) && ![[SandboxBroker sharedSandboxBroker] areAllPathsSafe:@[newURL]]) {
|
||||
[AppController globalShowPathSuggester];
|
||||
[[SandboxBroker sharedSandboxBroker] addFolderIfMissing:newURL];
|
||||
}
|
||||
self.rootURL = newURL;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ const FSEventStreamEventId eventIds[]) {
|
|||
- (void)setPath:(NSString *)path {
|
||||
[self cleanUp];
|
||||
|
||||
if(!path) return;
|
||||
|
||||
// Create FSEvent stream
|
||||
NSArray *pathsToWatch = @[path];
|
||||
|
||||
|
|
Loading…
Reference in New Issue