Revision: 28310
          http://sourceforge.net/p/bibdesk/svn/28310
Author:   hofman
Date:     2023-07-14 08:40:42 +0000 (Fri, 14 Jul 2023)
Log Message:
-----------
save files for local file fields in archive when not using linked files

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

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-07-13 14:24:46 UTC (rev 28309)
+++ trunk/bibdesk/BibDocument.m 2023-07-14 08:40:42 UTC (rev 28310)
@@ -1265,6 +1265,7 @@
     NSString *filePath;
     NSString *commonParent = nil;
     NSMutableSet *localFiles = [NSMutableSet set];
+    NSSet *localFileFields = [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKUseLocalUrlAndUrlKey] ? [[BDSKTypeManager sharedManager] 
localFileFieldsSet] : nil;
     BOOL success = [fm createDirectoryAtURL:folderURL 
withIntermediateDirectories:NO attributes:nil error:NULL];
     
     if (success) {
@@ -1278,6 +1279,15 @@
                         commonParent = [filePath 
stringByDeletingLastPathComponent];
                 }
             }
+            for (NSString *field in localFileFields) {
+                if ((filePath = [[item localFileURLForField:field] path]) && 
[fm fileExistsAtPath:filePath] && [ws isFolderAtPath:filePath] == NO) {
+                    [localFiles addObject:filePath];
+                    if (commonParent)
+                        commonParent = [[filePath 
stringByDeletingLastPathComponent] commonRootPathOfFile:commonParent];
+                    else
+                        commonParent = [filePath 
stringByDeletingLastPathComponent];
+                }
+            }
         }
         
         NSData *bibtexData = [self bibTeXDataDroppingInternal:NO 
relativeToPath:commonParent error:outError];

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