Revision: 16745
http://sourceforge.net/p/skim-app/code/16745
Author: hofman
Date: 2026-10-29 17:38:05 +0000 (Thu, 29 Oct 2026)
Log Message:
-----------
combine updating and comparing resolved alias
Modified Paths:
--------------
trunk/SKAlias.m
Modified: trunk/SKAlias.m
===================================================================
--- trunk/SKAlias.m 2026-10-29 17:32:08 UTC (rev 16744)
+++ trunk/SKAlias.m 2026-10-29 17:38:05 UTC (rev 16745)
@@ -180,12 +180,11 @@
}
- (BOOL)resolvesToFileURL:(NSURL *)fileURL {
+ NSURL *myFileURL = nil;
+ BOOL shouldUpdate = NO;
if (aliasHandle) {
- NSURL *myFileURL = fileURLFromAliasHandle(aliasHandle,
kResolveAliasFileNoUI);
- if (myFileURL == nil)
- return NO;
- [self updateWithURL:myFileURL];
- return [[myFileURL path] isCaseInsensitiveEqual:[fileURL path]];
+ myFileURL = fileURLFromAliasHandle(aliasHandle, kResolveAliasFileNoUI);
+ shouldUpdate = YES;
} else if (data) {
NSArray *keys = @[NSURLPathKey, NSURLFileIDKey,
NSURLVolumeUUIDStringKey];
NSDictionary *rsrcValues = [fileURL resourceValuesForKeys:keys
error:NULL];
@@ -200,7 +199,7 @@
[self updateWithURL:fileURL];
return YES;
}
- NSURL *myFileURL = [NSURL fileURLWithPath:myPath
isDirectory:[[myPath pathExtension] isCaseInsensitiveEqual:@"pdfd"]];
+ myFileURL = [NSURL fileURLWithPath:myPath isDirectory:[[myPath
pathExtension] isCaseInsensitiveEqual:@"pdfd"]];
if ([myFileURL checkResourceIsReachableAndReturnError:NULL]) {
if (fileID && myFileID && [fileID isEqual:myFileID] == NO)
[self updateWithURL:myFileURL];
@@ -220,15 +219,13 @@
}
}
NSURLBookmarkResolutionOptions options =
NSURLBookmarkResolutionWithoutUI | NSURLBookmarkResolutionWithoutMounting;
- BOOL shouldUpdate = NO;
- NSURL *myFileURL = [NSURL URLByResolvingBookmarkData:data
options:options relativeToURL:nil bookmarkDataIsStale:&shouldUpdate error:NULL];
- if (myFileURL == nil)
- return NO;
- if (shouldUpdate)
- [self updateWithURL:myFileURL];
- return [[myFileURL path] isCaseInsensitiveEqual:(path ?: [fileURL
path])];
+ myFileURL = [NSURL URLByResolvingBookmarkData:data options:options
relativeToURL:nil bookmarkDataIsStale:&shouldUpdate error:NULL];
}
- return NO;
+ if (myFileURL == nil)
+ return NO;
+ if (shouldUpdate)
+ [self updateWithURL:myFileURL];
+ return [[myFileURL path] isCaseInsensitiveEqual:[fileURL path]];
}
- (NSString *)name {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit