Revision: 28818
          http://sourceforge.net/p/bibdesk/svn/28818
Author:   hofman
Date:     2024-02-25 16:33:48 +0000 (Sun, 25 Feb 2024)
Log Message:
-----------
return a missing file URL forr display in file view when the URL is nil

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===================================================================
--- trunk/bibdesk/BDSKLinkedFile.m      2024-02-25 16:01:10 UTC (rev 28817)
+++ trunk/bibdesk/BDSKLinkedFile.m      2024-02-25 16:33:48 UTC (rev 28818)
@@ -42,6 +42,7 @@
 #import "NSString_BDSKExtensions.h"
 #import "NSURL_BDSKExtensions.h"
 #import "BDSKComplexString.h"
+#import <FileView/FileView.h>
 
 #define BDSKSaveLinkedFilesAsRelativePathOnlyKey 
@"BDSKSaveLinkedFilesAsRelativePathOnly"
 #define BDSKSaveLinkedFilesAsArchivedDataKey 
@"BDSKSaveLinkedFilesAsArchivedData"
@@ -475,7 +476,10 @@
     NSURL *displayURL = [self URL];
     if (displayURL == nil && relativePath) {
         NSString *basePath = [delegate basePathForLinkedFile:self];
-        displayURL = basePath ? [[NSURL URLWithString:[relativePath 
stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet 
URLPathAllowedCharacterSet]] relativeToURL:[NSURL fileURLWithPath:basePath 
isDirectory:YES]] absoluteURL] : [[NSURL fileURLWithPath:relativePath 
isDirectory:NO] absoluteURL];
+        if (basePath)
+            displayURL = [[FVFileView missingFileURLWithPath:[basePath 
stringByAppendingPathComponent:relativePath]] standardizedURL];
+        else
+            displayURL = [FVFileView missingFileURLWithPath:relativePath];
     }
     return displayURL;
 }

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