aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-06-04 22:34:15 +0000
committerrowanbeentje <rowan@beent.je>2012-06-04 22:34:15 +0000
commit41c6a1af0b7540c53a9de2e76c67b33ff56e907e (patch)
tree1b282d5f74b35c5e0ef1447d57d38747f74c2f0d /Source/SPConnectionController.m
parent0cd4120577b6e970f3425c49346332388a3d2fd4 (diff)
downloadsequelpro-41c6a1af0b7540c53a9de2e76c67b33ff56e907e.tar.gz
sequelpro-41c6a1af0b7540c53a9de2e76c67b33ff56e907e.tar.bz2
sequelpro-41c6a1af0b7540c53a9de2e76c67b33ff56e907e.zip
- Fix loss of password on certain connection editing actions (type changes, localhost/127.0.0.1 auto-type changes)
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 337fed11..8aa6ef54 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -1065,9 +1065,11 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
if (returnCode == NSAlertAlternateReturn) {
[self setType:SPSocketConnection];
[self setHost:@""];
+ [self _updateFavoritePasswordsFromField:standardSQLHostField];
}
else {
[self setHost:@"127.0.0.1"];
+ [self _updateFavoritePasswordsFromField:standardSQLHostField];
}
}
@@ -1222,6 +1224,15 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
(([favorite objectForKey:SPFavoriteHostKey]) ? [favorite valueForKeyPath:SPFavoriteHostKey] : @""))
]];
}
+
+ // Trigger a password change
+ if (previousType == SPSocketConnection) {
+ [self _updateFavoritePasswordsFromField:socketPasswordField];
+ } else if (previousType == SPSSHTunnelConnection) {
+ [self _updateFavoritePasswordsFromField:sshPasswordField];
+ } else {
+ [self _updateFavoritePasswordsFromField:standardPasswordField];
+ }
}
/**