aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-10-20 16:11:51 +0000
committerrowanbeentje <rowan@beent.je>2012-10-20 16:11:51 +0000
commit62b310ab2fa911c8b9e1d8b8f71d9186e938b347 (patch)
treeafb9c86f90dd61c17d5d300aa2f8b60fe241c58b
parentef3ff14707741bef3a1968a4d7a1845b5d87d4f1 (diff)
downloadsequelpro-62b310ab2fa911c8b9e1d8b8f71d9186e938b347.tar.gz
sequelpro-62b310ab2fa911c8b9e1d8b8f71d9186e938b347.tar.bz2
sequelpro-62b310ab2fa911c8b9e1d8b8f71d9186e938b347.zip
- Prevent new favourites from being created as a sibling/child of the Quick Connect item if it was selected
- Name a last unnamed connection thread
-rw-r--r--Source/SPConnectionController.m4
-rw-r--r--Source/SPConnectionHandler.m5
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];
}
/**