Revision: 16726
          http://sourceforge.net/p/skim-app/code/16726
Author:   hofman
Date:     2026-10-27 16:05:18 +0000 (Tue, 27 Oct 2026)
Log Message:
-----------
attempt resolving bookmark data without UI by first trying path resource value 
to avoid triggering an iCould download

Modified Paths:
--------------
    trunk/SKAlias.m

Modified: trunk/SKAlias.m
===================================================================
--- trunk/SKAlias.m     2026-10-27 14:51:44 UTC (rev 16725)
+++ trunk/SKAlias.m     2026-10-27 16:05:18 UTC (rev 16726)
@@ -37,6 +37,7 @@
  */
 
 #import "SKAlias.h"
+#import "NSString_SKExtensions.h"
 
 
 @implementation SKAlias
@@ -142,8 +143,18 @@
         fileURL = fileURLFromAliasHandle(aliasHandle, allowUI ? 0 : 
kResolveAliasFileNoUI);
         shouldUpdate = YES;
     } else if (data) {
-        NSURLBookmarkResolutionOptions options = allowUI ? 0 : 
NSURLBookmarkResolutionWithoutUI | NSURLBookmarkResolutionWithoutMounting;
-        fileURL = [NSURL URLByResolvingBookmarkData:data options:options 
relativeToURL:nil bookmarkDataIsStale:&shouldUpdate error:NULL];
+        if (allowUI == NO) {
+            NSString *path = [[NSURL resourceValuesForKeys:@[NSURLPathKey] 
fromBookmarkData:data] objectForKey:NSURLPathKey];
+            if (path) {
+                fileURL = [NSURL fileURLWithPath:path isDirectory:[[path 
pathExtension] isCaseInsensitiveEqual:@"pdfd"]];
+                if ([fileURL checkResourceIsReachableAndReturnError:NULL] == 
NO)
+                    fileURL = nil;
+            }
+        }
+        if (fileURL == nil) {
+            NSURLBookmarkResolutionOptions options = allowUI ? 0 : 
NSURLBookmarkResolutionWithoutUI | NSURLBookmarkResolutionWithoutMounting;
+            fileURL = [NSURL URLByResolvingBookmarkData:data options:options 
relativeToURL:nil bookmarkDataIsStale:&shouldUpdate error:NULL];
+        }
     }
     if (shouldUpdate && fileURL) {
         NSData *bmData = [fileURL bookmarkDataWithOptions:0 
includingResourceValuesForKeys:nil relativeToURL:nil error:NULL];

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

Reply via email to