Revision: 27552
          http://sourceforge.net/p/bibdesk/svn/27552
Author:   hofman
Date:     2022-06-04 18:11:06 +0000 (Sat, 04 Jun 2022)
Log Message:
-----------
use URL fields for metadata when not using linked files

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

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2022-06-04 18:07:43 UTC (rev 27551)
+++ trunk/bibdesk/BibItem.m     2022-06-04 18:11:06 UTC (rev 27552)
@@ -1686,18 +1686,25 @@
     // kMDItemWhereFroms is the closest we get to a URL field, so add our 
standard fields if available
     NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:2];
     NSURL *url;
-    BDSKLinkedFile *file;
-    
-    for (file in [self localFiles]) {
-        if ((url = [file URL]))
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKUseLocalUrlAndUrlKey]) {
+        if ((url = [self localFileURLForField:BDSKLocalUrlString]))
             [mutableArray addObject:[url absoluteString]];
+        if ((url = [self remoteURLForField:BDSKUrlString]))
+            [mutableArray addObject:[url absoluteString]];
+    } else {
+        BDSKLinkedFile *file;
+        
+        for (file in [self localFiles]) {
+            if ((url = [file URL]))
+                [mutableArray addObject:[url absoluteString]];
+        }
+        
+        for (file in [self remoteURLs]) {
+            if ((url = [file URL]))
+                [mutableArray addObject:[url absoluteString]];
+        }
     }
     
-    for (file in [self remoteURLs]) {
-        if ((url = [file URL]))
-            [mutableArray addObject:[url absoluteString]];
-    }
-
     [info setObject:mutableArray forKey:(NSString *)kMDItemWhereFroms];
     [mutableArray release];
     

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