Revision: 28780
          http://sourceforge.net/p/bibdesk/svn/28780
Author:   hofman
Date:     2024-02-20 18:18:39 +0000 (Tue, 20 Feb 2024)
Log Message:
-----------
get file path url back from file ref url after getting it from relative path or 
bookmark data, so we get a normalized path

Modified Paths:
--------------
    trunk/bibdesk/BDSKLinkedFile.m

Modified: trunk/bibdesk/BDSKLinkedFile.m
===================================================================
--- trunk/bibdesk/BDSKLinkedFile.m      2024-02-20 17:51:16 UTC (rev 28779)
+++ trunk/bibdesk/BDSKLinkedFile.m      2024-02-20 18:18:39 UTC (rev 28780)
@@ -840,15 +840,18 @@
         basePath = [delegate basePathForLinkedFile:self];
         
         if (aURL == nil && basePath && relativePath) {
-            aURL = [[NSURL alloc] initFileURLWithPath:[relativePath 
isAbsolutePath] ? relativePath : [[basePath 
stringByAppendingPathComponent:relativePath] stringByStandardizingPath] 
isDirectory:NO];
+            aURL = [[NSURL alloc] initFileURLWithPath:[relativePath 
isAbsolutePath] ? relativePath : [basePath 
stringByAppendingPathComponent:relativePath] isDirectory:NO];
             refURL = [aURL fileReferenceURL];
+            aURL = [refURL filePathURL] ?: aURL;
             shouldUpdate = refURL != nil;
         }
         
         if (refURL == nil && [alias isKindOfClass:[NSData class]]) {
             aURL = [[NSURL alloc] initByResolvingBookmarkData:alias 
options:NSURLBookmarkResolutionWithoutUI | 
NSURLBookmarkResolutionWithoutMounting relativeToURL:nil 
bookmarkDataIsStale:&shouldUpdate error:NULL];
-            if (aURL)
+            if (aURL) {
                 refURL = [aURL fileReferenceURL];
+                aURL = [refURL filePathURL] ?: aURL;
+            }
             shouldUpdate = shouldUpdate && aURL != nil;
         } else if (aURL == nil && [alias isKindOfClass:[BDSKAlias class]]) {
             FSRef aRef, baseRef;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to