Revision: 16759
          http://sourceforge.net/p/skim-app/code/16759
Author:   hofman
Date:     2026-10-31 15:50:47 +0000 (Sat, 31 Oct 2026)
Log Message:
-----------
method to cache the fileURL

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

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2026-10-31 15:43:24 UTC (rev 16758)
+++ trunk/SKBookmark.m  2026-10-31 15:50:47 UTC (rev 16759)
@@ -530,13 +530,17 @@
     cachedFileURL = nil;
 }
 
+- (void)cacheFileURL:(NSURL *)fileURL {
+    cachedFileURL = fileURL ?: (id)[NSNull null];
+    __weak typeof(self) weakSelf = self;
+    dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf 
clearCachedFileURL]; });
+}
+
 - (NSURL *)fileURL {
     NSURL *fileURL = nil;
     if (cachedFileURL == nil) {
         fileURL = [alias fileURLNoUI];
-        cachedFileURL = fileURL ?: (id)[NSNull null];
-        __weak typeof(self) weakSelf = self;
-        dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf 
clearCachedFileURL]; });
+        [self cacheFileURL:fileURL];
     } else if ([cachedFileURL isEqual:[NSNull null]] == NO) {
         fileURL = cachedFileURL;
     }
@@ -557,13 +561,10 @@
         fileURL = cachedFileURL;
     } else {
         fileURL = [alias fileURL];
-        if (cachedFileURL == nil) {
-            cachedFileURL = fileURL ?: (id)[NSNull null];
-            __weak typeof(self) weakSelf = self;
-            dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf 
clearCachedFileURL]; });
-        } else if (fileURL) {
+        if (cachedFileURL == nil)
+            [self cacheFileURL:fileURL];
+        else if (fileURL)
             cachedFileURL = fileURL;
-        }
     }
     return fileURL;
 }

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