diff options
author | stuconnolly <stuart02@gmail.com> | 2012-05-03 12:05:01 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-05-03 12:05:01 +0000 |
commit | 83fa503079f7a049ffab9747b0360046474f3253 (patch) | |
tree | 028d0a92e558ba42e796847ab0f68d6e3037fb50 /Source/SPFavoritesController.m | |
parent | 0d3af5fe7631325e8a892011f0595c76b1ebd49a (diff) | |
download | sequelpro-83fa503079f7a049ffab9747b0360046474f3253.tar.gz sequelpro-83fa503079f7a049ffab9747b0360046474f3253.tar.bz2 sequelpro-83fa503079f7a049ffab9747b0360046474f3253.zip |
Add support for saving the state of the connection favorites outline view.
Diffstat (limited to 'Source/SPFavoritesController.m')
-rw-r--r-- | Source/SPFavoritesController.m | 10 |
1 files changed, 7 insertions, 3 deletions
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]; } |