aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-11-18 22:36:04 +0000
committerstuconnolly <stuart02@gmail.com>2012-11-18 22:36:04 +0000
commit7ce6e8149f1f1050036d1682907e453f1f205eee (patch)
tree63825e8a072c2ad95180644503c827a8e76e7538
parenta1ffa498a2e23d5f98822d5ee2e7c2a0cc8b2e8e (diff)
downloadsequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.tar.gz
sequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.tar.bz2
sequelpro-7ce6e8149f1f1050036d1682907e453f1f205eee.zip
Fix the selected node in the favorites connection view when adding a new favorite to an empty group.
-rw-r--r--Source/SPConnectionController.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 073dc53c..a8c9da8d 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -107,7 +107,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
@end
-
@implementation SPConnectionController
@synthesize delegate;
@@ -740,12 +739,14 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
SPTreeNode *selectedNode = [self selectedFavoriteNode];
SPTreeNode *parent = ([selectedNode isGroup] && selectedNode != quickConnectItem) ? selectedNode : (SPTreeNode *)[selectedNode parentNode];
-
- // Ensure the parent is expanded
- [favoritesOutlineView expandItem:parent];
SPTreeNode *node = [favoritesController addFavoriteNodeWithData:favorite asChildOfNode:parent];
+ //[self _reloadFavoritesViewData];
+
+ // Ensure the parent is expanded
+ [favoritesOutlineView expandItem:parent];
+
[self _sortFavorites];
[self _selectNode:node];
@@ -1513,6 +1514,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
{
[favoritesOutlineView reloadData];
[favoritesOutlineView expandItem:[[favoritesRoot childNodes] objectAtIndex:0] expandChildren:NO];
+
[self _scrollToSelectedNode];
}
@@ -1600,7 +1602,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
*/
- (void)_scrollToSelectedNode
{
-
// Don't scroll if no node is currently selected
if ([favoritesOutlineView selectedRow] == -1) return;