summaryrefslogtreecommitdiffstats
path: root/macosx/HBUtilities.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-01-25 11:03:00 +0100
committerDamiano Galassi <[email protected]>2017-01-25 11:03:00 +0100
commit178071e0ce842af53e8c51e6275e8956fc4aa27c (patch)
tree6337430f7ec1900ce562bf394954469cc68b80d2 /macosx/HBUtilities.m
parent79c33c0ca996311224bbd3719c85238a3358cb5e (diff)
MacGui: improve management of security scoped resources. Fix external SRT in the sandboxed build.
Diffstat (limited to 'macosx/HBUtilities.m')
-rw-r--r--macosx/HBUtilities.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/macosx/HBUtilities.m b/macosx/HBUtilities.m
index a0db9927b..8d83f46f3 100644
--- a/macosx/HBUtilities.m
+++ b/macosx/HBUtilities.m
@@ -71,13 +71,13 @@
return isStale ? nil : url;
}
-+ (nullable NSData *)bookmarkFromURL:(NSURL *)url
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url options:(NSURLBookmarkCreationOptions)options
{
NSParameterAssert(url);
NSError *error;
- NSData *bookmark = [url bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys:nil relativeToURL:nil error:&error];
+ NSData *bookmark = [url bookmarkDataWithOptions:options includingResourceValuesForKeys:nil relativeToURL:nil error:&error];
if (error)
{
@@ -88,6 +88,11 @@
return bookmark;
}
++ (nullable NSData *)bookmarkFromURL:(NSURL *)url
+{
+ return [HBUtilities bookmarkFromURL:url options:NSURLBookmarkCreationWithSecurityScope];
+}
+
+ (NSString *)displayNameForURL:(NSURL *)URL
{
NSString *displayName = URL.lastPathComponent;