From 585598dee1cc9f53e37ff47b5548bd034cdefee4 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 28 Nov 2012 02:09:13 +0000 Subject: - Improve connection testing to use edited passwords on a connection with keychain entries - Clean up connection error handling slightly --- Source/SPConnectionController.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Source/SPConnectionController.m') diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 8cb08556..d1d7ba2f 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1576,12 +1576,15 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [progressIndicatorText setHidden:YES]; [progressIndicatorText display]; - // Update the password fields, restoring passwords that may have been bulletted out during connection - if (connectionKeychainItemName) { - [self setPassword:[keychain getPasswordForName:connectionKeychainItemName account:connectionKeychainItemAccount]]; - } - if (connectionSSHKeychainItemName) { - [self setSshPassword:[keychain getPasswordForName:connectionSSHKeychainItemName account:connectionSSHKeychainItemAccount]]; + // If not testing a connection,uUpdate the password fields, restoring passwords that may have + // been bulleted out during connection + if (!isTestingConnection) { + if (connectionKeychainItemName) { + [self setPassword:[keychain getPasswordForName:connectionKeychainItemName account:connectionKeychainItemAccount]]; + } + if (connectionSSHKeychainItemName) { + [self setSshPassword:[keychain getPasswordForName:connectionSSHKeychainItemName account:connectionSSHKeychainItemAccount]]; + } } // Re-enable favorites table view -- cgit v1.2.3