From 88660884d44b9bbb743cc911a7fc1dc9c124e632 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 5 Jun 2012 13:30:15 +0000 Subject: - Fix loss of connection name/password for SSH connections whn switching from an empty selection - Fix a build warning --- Source/SPConnectionController.m | 8 ++++++-- Source/SPConnectionHandler.m | 2 ++ 2 files changed, 8 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] : @"")]; diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index ca488872..fdc3d35e 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -39,6 +39,8 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; - (void)_restoreConnectionInterface; +- (void)_updateFavoritePasswordsFromField:(NSControl *)control; + @end @implementation SPConnectionController (SPConnectionHandler) -- cgit v1.2.3