Revision: 15179
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15179&view=rev
Author:   hofman
Date:     2009-04-24 19:30:00 +0000 (Fri, 24 Apr 2009)

Log Message:
-----------
save class names of expanded parent groups rather than the name, because the 
name can be changed but the class is unique.

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

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2009-04-24 17:43:20 UTC (rev 15178)
+++ trunk/bibdesk/BibDocument.m 2009-04-24 19:30:00 UTC (rev 15179)
@@ -364,16 +364,13 @@
     // some xattr setup has to be done after the window is on-screen
     NSDictionary *xattrDefaults = [self 
mainWindowSetupDictionaryFromExtendedAttributes];
     
-    NSArray *groupsToExpand = [xattrDefaults 
objectForKey:BDSKDocumentGroupsToExpandKey defaultObject:[groups 
valueForKey:@"name"]];
-    NSEnumerator *groupEnum = [groupsToExpand objectEnumerator];
-    NSString *groupName;
-    while (groupName = [groupEnum nextObject]) {
-        NSEnumerator *parentEnum = [groups objectEnumerator];
-        BDSKParentGroup *parent;
-        while (parent = [parentEnum nextObject]) {
-            if ([[parent name] isEqual:groupName])
-                [groupOutlineView expandItem:parent];
-        }
+    NSArray *groupsToExpand = [xattrDefaults 
objectForKey:BDSKDocumentGroupsToExpandKey];
+    NSEnumerator *parentEnum = [groups objectEnumerator];
+    BDSKParentGroup *parent;
+    [parentEnum nextObject];
+    while (parent = [parentEnum nextObject]) {
+        if (groupsToExpand == nil || [groupsToExpand 
containsObject:NSStringFromClass([parent class])])
+            [groupOutlineView expandItem:parent];
     }
     // make sure the groups are sorted and have their sort descriptors set
     [self sortGroupsByKey:nil];
@@ -804,10 +801,10 @@
         NSMutableArray *groupsToExpand = [NSMutableArray array];
         NSEnumerator *groupEnum = [groups objectEnumerator];
         BDSKParentGroup *parent;
+        [groupEnum nextObject];
         while (parent = [groupEnum nextObject]) {
-            // name is localized, but that's not worth worrying about
             if ([groupOutlineView isItemExpanded:parent])
-                [groupsToExpand addObject:[parent name]];
+                [groupsToExpand addObject:NSStringFromClass([parent class])];
             
         }
         [dictionary setObject:groupsToExpand 
forKey:BDSKDocumentGroupsToExpandKey];


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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to