diff options
-rw-r--r-- | Source/SPConnectionController.m | 4 | ||||
-rw-r--r-- | Source/SPConnectionHandler.m | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index acf270f9..b9ab0510 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -739,7 +739,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, SPTreeNode *selectedNode = [self selectedFavoriteNode]; - SPTreeNode *parent = ([selectedNode isGroup]) ? selectedNode : (SPTreeNode *)[selectedNode parentNode]; + SPTreeNode *parent = ([selectedNode isGroup] && selectedNode != quickConnectItem) ? selectedNode : (SPTreeNode *)[selectedNode parentNode]; // Ensure the parent is expanded [favoritesOutlineView expandItem:parent]; @@ -1292,7 +1292,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, SPTreeNode *parentNode = nil; // If the current node is a group node, create the favorite as a child of it - if ([selectedNode isGroup]) { + if ([selectedNode isGroup] && selectedNode != quickConnectItem) { parentNode = selectedNode; // Otherwise, create the new node as a sibling of the selected node if possible diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index 6efdf366..0634df68 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -37,6 +37,7 @@ #import "SPKeychain.h" #import "RegexKitLite.h" #import "SPCategoryAdditions.h" +#import "SPThreadAdditions.h" #import <SPMySQL/SPMySQL.h> @@ -75,8 +76,8 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; [connectButton setEnabled:YES]; [connectButton display]; #endif - - [NSThread detachNewThreadSelector:@selector(initiateMySQLConnectionInBackground) toTarget:self withObject:nil]; + + [NSThread detachNewThreadWithName:@"SPConnectionHandler MySQL connection task" target:self selector:@selector(initiateMySQLConnectionInBackground) object:nil]; } /** |