Revision: 22419
          http://sourceforge.net/p/bibdesk/svn/22419
Author:   hofman
Date:     2018-07-14 11:18:46 +0000 (Sat, 14 Jul 2018)
Log Message:
-----------
always make sure custom fields are updated when changing automatically

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

Modified: trunk/bibdesk/BDSKAppController.m
===================================================================
--- trunk/bibdesk/BDSKAppController.m   2018-07-14 09:42:59 UTC (rev 22418)
+++ trunk/bibdesk/BDSKAppController.m   2018-07-14 11:18:46 UTC (rev 22419)
@@ -251,6 +251,7 @@
     // enforce Author and Editor as person fields
     NSArray *fields = [sud stringArrayForKey:BDSKPersonFieldsKey];
     NSInteger idx = 0;
+    BOOL didChange = NO;
     if ([fields containsObject:BDSKAuthorString] == NO || [fields 
containsObject:BDSKEditorString] == NO) {
         fields  = [fields mutableCopy];
         if ([fields containsObject:BDSKAuthorString] == NO)
@@ -259,7 +260,7 @@
             [(NSMutableArray *)fields insertObject:BDSKEditorString 
atIndex:idx];
         [sud setObject:fields forKey:BDSKPersonFieldsKey];
         [fields release];
-        [[BDSKTypeManager sharedManager] updateCustomFields];
+        didChange = YES;
     }
     if ([sud boolForKey:BDSKUseLocalUrlAndUrlKey]) {
         // enforce Local-Url as local file field and Url as remote URL field
@@ -269,6 +270,7 @@
             [(NSMutableArray *)fields insertObject:BDSKLocalUrlString 
atIndex:0];
             [sud setObject:fields forKey:BDSKUseLocalUrlAndUrlKey];
             [fields release];
+            didChange = YES;
         }
         fields = [sud stringArrayForKey:BDSKRemoteURLFieldsKey];
         if ([fields containsObject:BDSKUrlString] == NO) {
@@ -276,8 +278,11 @@
             [(NSMutableArray *)fields insertObject:BDSKUrlString atIndex:0];
             [sud setObject:fields forKey:BDSKRemoteURLFieldsKey];
             [fields release];
+            didChange = YES;
         }
     }
+    if (didChange)
+        [[BDSKTypeManager sharedManager] updateCustomFields];
 }
 
 #pragma mark Application delegate

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to