Compare commits
4 commits
cc2641f1f7
...
f7c6cd2900
Author | SHA1 | Date | |
---|---|---|---|
|
f7c6cd2900 | ||
|
db31f41105 | ||
|
01754e9072 | ||
|
b724187707 |
2 changed files with 2 additions and 31 deletions
|
@ -45,27 +45,10 @@
|
||||||
|
|
||||||
if(results && [results count] > 0) {
|
if(results && [results count] > 0) {
|
||||||
for(SandboxToken *token in results) {
|
for(SandboxToken *token in results) {
|
||||||
BOOL isDisconnected = NO;
|
|
||||||
BOOL isStale = YES;
|
BOOL isStale = YES;
|
||||||
NSError *err = nil;
|
NSError *err = nil;
|
||||||
{
|
|
||||||
NSDictionary *dict = [NSURL resourceValuesForKeys:@[NSURLVolumeURLKey] fromBookmarkData:token.bookmark];
|
|
||||||
if(dict) {
|
|
||||||
NSURL *volumeUrl = dict[NSURLVolumeURLKey];
|
|
||||||
if(volumeUrl && [volumeUrl isFileURL] && [volumeUrl path]) {
|
|
||||||
if(![[NSFileManager defaultManager] fileExistsAtPath:[volumeUrl path]]) {
|
|
||||||
isDisconnected = YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!isDisconnected) {
|
|
||||||
NSURL *bookmarkUrl = [NSURL URLByResolvingBookmarkData:token.bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&err];
|
NSURL *bookmarkUrl = [NSURL URLByResolvingBookmarkData:token.bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&err];
|
||||||
[self addObject:@{ @"path": token.path, @"valid": ((!bookmarkUrl || isStale) ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder), @"token": token }];
|
[self addObject:@{ @"path": token.path, @"valid": ((!bookmarkUrl || isStale) ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder), @"token": token }];
|
||||||
} else {
|
|
||||||
[self addObject:@{ @"path": token.path, @"valid": NSLocalizedPrefString(@"ValidNo"), @"isFolder": @(token.folder), @"token": token }];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,18 +192,6 @@ static SandboxBroker *kSharedSandboxBroker = nil;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if(ret) {
|
|
||||||
NSDictionary *dict = [NSURL resourceValuesForKeys:@[NSURLVolumeURLKey] fromBookmarkData:ret.token.bookmark];
|
|
||||||
if(dict) {
|
|
||||||
NSURL *volumeUrl = dict[NSURLVolumeURLKey];
|
|
||||||
if(volumeUrl && [volumeUrl isFileURL] && [volumeUrl path]) {
|
|
||||||
if(![[NSFileManager defaultManager] fileExistsAtPath:[volumeUrl path]]) {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ret) {
|
if(ret) {
|
||||||
BOOL isStale;
|
BOOL isStale;
|
||||||
NSError *err = nil;
|
NSError *err = nil;
|
||||||
|
|
Loading…
Reference in a new issue