From 83fa503079f7a049ffab9747b0360046474f3253 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 3 May 2012 12:05:01 +0000 Subject: Add support for saving the state of the connection favorites outline view. --- Source/SPFavoritesController.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Source/SPFavoritesController.m') diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index 45eb5c9a..1dee4a2b 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -262,6 +262,8 @@ static SPFavoritesController *sharedFavoritesController = nil; SPGroupNode *rootGroupNode = [[SPGroupNode alloc] init]; SPGroupNode *favoritesGroupNode = [[SPGroupNode alloc] initWithName:[[root objectForKey:SPFavoritesGroupNameKey] uppercaseString]]; + [favoritesGroupNode setNodeIsExpanded:[[root objectForKey:SPFavoritesGroupIsExpandedKey] boolValue]]; + SPTreeNode *rootNode = [[SPTreeNode alloc] initWithRepresentedObject:rootGroupNode]; SPTreeNode *favoritesNode = [[SPTreeNode alloc] initWithRepresentedObject:favoritesGroupNode]; @@ -282,7 +284,7 @@ static SPFavoritesController *sharedFavoritesController = nil; [favoritesNode release]; favoritesTree = rootNode; - + pthread_mutex_unlock(&favoritesLock); } @@ -298,11 +300,13 @@ static SPFavoritesController *sharedFavoritesController = nil; { id node = nil; SPTreeNode *treeNode = nil; - + if ([nodeData objectForKey:SPFavoritesGroupNameKey] && [nodeData objectForKey:SPFavoriteChildrenKey]) { node = [[SPGroupNode alloc] initWithName:[nodeData objectForKey:SPFavoritesGroupNameKey]]; + [node setNodeIsExpanded:[[nodeData objectForKey:SPFavoritesGroupIsExpandedKey] boolValue]]; + treeNode = [[SPTreeNode alloc] initWithRepresentedObject:node]; [node release]; @@ -323,7 +327,7 @@ static SPFavoritesController *sharedFavoritesController = nil; [node release]; } - + return [treeNode autorelease]; } -- cgit v1.2.3