aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-06-05 13:30:15 +0000
committerrowanbeentje <rowan@beent.je>2012-06-05 13:30:15 +0000
commit88660884d44b9bbb743cc911a7fc1dc9c124e632 (patch)
treeb8af9f28f4288585ac47ab39b5f1313abe8d66c6 /Source/SPConnectionController.m
parentf4333250c7b96df042d49db86d9e56cff42f0969 (diff)
downloadsequelpro-88660884d44b9bbb743cc911a7fc1dc9c124e632.tar.gz
sequelpro-88660884d44b9bbb743cc911a7fc1dc9c124e632.tar.bz2
sequelpro-88660884d44b9bbb743cc911a7fc1dc9c124e632.zip
- Fix loss of connection name/password for SSH connections whn switching from an empty selection
- Fix a build warning
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 2c622cee..f1b80684 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -486,9 +486,13 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
currentFavorite = [fav copy];
[connectionResizeContainer setHidden:NO];
-
+
+ // Set up the type, also storing it in the previous type store to prevent type "changes" triggering actions
+ NSUInteger connectionType = ([fav objectForKey:SPFavoriteTypeKey] ? [[fav objectForKey:SPFavoriteTypeKey] integerValue] : SPTCPIPConnection);
+ previousType = connectionType;
+ [self setType:connectionType];
+
// Standard details
- [self setType:([fav objectForKey:SPFavoriteTypeKey] ? [[fav objectForKey:SPFavoriteTypeKey] integerValue] : SPTCPIPConnection)];
[self setName:([fav objectForKey:SPFavoriteNameKey] ? [fav objectForKey:SPFavoriteNameKey] : @"")];
[self setHost:([fav objectForKey:SPFavoriteHostKey] ? [fav objectForKey:SPFavoriteHostKey] : @"")];
[self setSocket:([fav objectForKey:SPFavoriteSocketKey] ? [fav objectForKey:SPFavoriteSocketKey] : @"")];