save collapsed groups between launches

This commit is contained in:
Mitchell Livingston
2008-02-07 21:26:04 +00:00
parent 4d472ae9f7
commit a06c1ace83
3 changed files with 12 additions and 1 deletions

View File

@@ -63,7 +63,11 @@
if (![NSApp isOnLeopardOrBetter])
[[self tableColumnWithIdentifier: @"Torrent"] setDataCell: fTorrentCell];
fCollapsedGroups = [[NSMutableIndexSet alloc] init];
NSData * groupData = [fDefaults dataForKey: @"CollapsedGroups"];
if (groupData)
fCollapsedGroups = [[NSUnarchiver unarchiveObjectWithData: groupData] retain];
else
fCollapsedGroups = [[NSMutableIndexSet alloc] init];
fMouseControlRow = -1;
fMouseRevealRow = -1;
@@ -113,6 +117,11 @@
[fCollapsedGroups removeAllIndexes];
}
- (void) saveCollapsedGroups
{
[fDefaults setObject: [NSArchiver archivedDataWithRootObject: fCollapsedGroups] forKey: @"CollapsedGroups"];
}
- (BOOL) outlineView: (NSOutlineView *) outlineView isGroupItem: (id) item
{
return ![item isKindOfClass: [Torrent class]];