Revision: 28318
          http://sourceforge.net/p/bibdesk/svn/28318
Author:   hofman
Date:     2023-07-16 14:45:24 +0000 (Sun, 16 Jul 2023)
Log Message:
-----------
use -basePath from owner for local file fields

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

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2023-07-16 14:39:50 UTC (rev 28317)
+++ trunk/bibdesk/BibItem.m     2023-07-16 14:45:24 UTC (rev 28318)
@@ -2992,8 +2992,7 @@
             
             // check to see if it's a relative path
             if([localURLFieldValue isAbsolutePath] == NO){
-                NSString *docPath = [[owner fileURL] path];
-                NSString *basePath = [NSString isEmptyString:docPath] ? 
NSHomeDirectory() : [docPath stringByDeletingLastPathComponent];
+                NSString *basePath = [owner basePath] ?: NSHomeDirectory();
                 // It's a relative path from the containing document's path
                 localURLFieldValue = [basePath 
stringByAppendingPathComponent:localURLFieldValue];
             }
@@ -3195,7 +3194,7 @@
        
        if (nil == requiredFields || 
         ([NSString isEmptyString:[[NSUserDefaults standardUserDefaults] 
stringForKey:BDSKPapersFolderPathKey]] && 
-               [NSString isEmptyString:[[[owner fileURL] path] 
stringByDeletingLastPathComponent]]))
+               [NSString isEmptyString:[owner basePath]]))
                return NO;
        
        for (NSString *fieldName in requiredFields) {
@@ -3277,7 +3276,7 @@
     
     if (nil == requiredFields ||
         ([NSString isEmptyString:[[NSUserDefaults standardUserDefaults] 
stringForKey:BDSKPapersFolderPathKey]] &&
-         [NSString isEmptyString:[[[owner fileURL] path] 
stringByDeletingLastPathComponent]]))
+         [NSString isEmptyString:[owner basePath]]))
         return NO;
     
     for (NSString *fieldName in requiredFields) {

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to