Changeset 5984


Ignore:
Timestamp:
May 31, 2008, 3:11:59 AM (14 years ago)
Author:
livings124
Message:

don't archive group images; update group images when colors change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsController.m

    r5983 r5984  
    158158- (NSColor *) setColor: (NSColor *) color forIndex: (int) index
    159159{
    160     [[fGroups objectAtIndex: [self rowValueForIndex: index]] setObject: color forKey: @"Color"];
     160    NSMutableDictionary * dict = [fGroups objectAtIndex: [self rowValueForIndex: index]];
     161    [dict removeObjectForKey: @"Icon"];
     162   
     163    [dict setObject: color forKey: @"Color"];
    161164   
    162165    [[GroupsController groups] saveGroups];
     
    297300- (void) saveGroups
    298301{
    299     [[NSUserDefaults standardUserDefaults] setObject: [NSArchiver archivedDataWithRootObject: fGroups] forKey: @"Groups"];
     302    //don't archive the icon
     303    NSMutableArray * groups = [NSMutableArray arrayWithCapacity: [fGroups count]];
     304    NSEnumerator * enumerator = [fGroups objectEnumerator];
     305    NSDictionary * dict;
     306    while ((dict = [enumerator nextObject]))
     307    {
     308        NSMutableDictionary * newDict = [dict mutableCopy];
     309        [newDict removeObjectForKey: @"Icon"];
     310        [groups addObject: newDict];
     311        [newDict release];
     312    }
     313   
     314    [[NSUserDefaults standardUserDefaults] setObject: [NSArchiver archivedDataWithRootObject: groups] forKey: @"Groups"];
    300315}
    301316
Note: See TracChangeset for help on using the changeset viewer.