Revision: 26519
          http://sourceforge.net/p/bibdesk/svn/26519
Author:   hofman
Date:     2021-07-27 21:13:44 +0000 (Tue, 27 Jul 2021)
Log Message:
-----------
Stop editing category groups before removing category. Build category before 
adding.

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

Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m  2021-07-27 15:02:35 UTC (rev 26518)
+++ trunk/bibdesk/BibDocument_Groups.m  2021-07-27 21:13:44 UTC (rev 26519)
@@ -698,11 +698,11 @@
 - (void)addCurrentGroupField:(NSString *)newField {
     if ([[self currentGroupFields] containsObject:newField] == NO) {
         BDSKCategoryParentGroup *group = [[[BDSKCategoryParentGroup alloc] 
initWithKey:newField] autorelease];
-        // this is to set the sort descriptors, children are automatically 
sorted when added
+        [self rebuildCategoryGroups:group];
         [self modifyChildrenOfParentGroup:nil changes:^{
             [groups addCategoryParent:group];
-            [self rebuildCategoryGroups:group];
         }];
+        // this is to set the sort descriptors and sorts the children
         [groupOutlineView expandItem:group];
         [[NSUserDefaults standardUserDefaults] setObject:[self 
currentGroupFields] forKey:BDSKCurrentGroupFieldsKey];
     }
@@ -711,6 +711,7 @@
 - (void)removeCurrentGroupField:(NSString *)oldField {
     for (BDSKCategoryParentGroup *group in [groups categoryParents]) {
         if ([[group key] isEqualToString:oldField]) {
+            [self willRemoveGroups:[group children]];
             [self modifyChildrenOfParentGroup:nil changes:^{
                 [groups removeCategoryParent:group];
             }];

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