aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-12-14 23:05:55 +0000
committerrowanbeentje <rowan@beent.je>2012-12-14 23:05:55 +0000
commit3cfe628ecc4b51ff2e1013f2260ef5f056db8b97 (patch)
treecd8c6e1564cc30d3c31e5109658dc543d0b09db7 /Source
parent3b5642c68f57865888b60a1f846fed3810333dae (diff)
downloadsequelpro-3cfe628ecc4b51ff2e1013f2260ef5f056db8b97.tar.gz
sequelpro-3cfe628ecc4b51ff2e1013f2260ef5f056db8b97.tar.bz2
sequelpro-3cfe628ecc4b51ff2e1013f2260ef5f056db8b97.zip
- Fix favourite editing on the connection interface being unable to delete some properties
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConnectionController.m28
1 files changed, 25 insertions, 3 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index d1d7ba2f..1da6b46f 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -1150,50 +1150,72 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
[theFavorite setObject:[NSNumber numberWithInteger:[self type]] forKey:SPFavoriteTypeKey];
if ([self host]) {
[theFavorite setObject:[self host] forKey:SPFavoriteHostKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteHostKey];
}
if ([self socket]) {
[theFavorite setObject:[self socket] forKey:SPFavoriteSocketKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSocketKey];
}
if ([self user]) {
[theFavorite setObject:[self user] forKey:SPFavoriteUserKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteUserKey];
}
if ([self port]) {
[theFavorite setObject:[self port] forKey:SPFavoritePortKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoritePortKey];
}
if ([self database]) {
[theFavorite setObject:[self database] forKey:SPFavoriteDatabaseKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteDatabaseKey];
}
// SSL details
- if ([self useSSL]) {
- [theFavorite setObject:[NSNumber numberWithInteger:[self useSSL]] forKey:SPFavoriteUseSSLKey];
- }
+ [theFavorite setObject:[NSNumber numberWithInteger:[self useSSL]] forKey:SPFavoriteUseSSLKey];
[theFavorite setObject:[NSNumber numberWithInteger:[self sslKeyFileLocationEnabled]] forKey:SPFavoriteSSLKeyFileLocationEnabledKey];
if ([self sslKeyFileLocation]) {
[theFavorite setObject:[self sslKeyFileLocation] forKey:SPFavoriteSSLKeyFileLocationKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSLKeyFileLocationKey];
}
[theFavorite setObject:[NSNumber numberWithInteger:[self sslCertificateFileLocationEnabled]] forKey:SPFavoriteSSLCertificateFileLocationEnabledKey];
if ([self sslCertificateFileLocation]) {
[theFavorite setObject:[self sslCertificateFileLocation] forKey:SPFavoriteSSLCertificateFileLocationKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSLCertificateFileLocationKey];
}
[theFavorite setObject:[NSNumber numberWithInteger:[self sslCACertFileLocationEnabled]] forKey:SPFavoriteSSLCACertFileLocationEnabledKey];
if ([self sslCACertFileLocation]) {
[theFavorite setObject:[self sslCACertFileLocation] forKey:SPFavoriteSSLCACertFileLocationKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSLCACertFileLocationKey];
}
// SSH details
if ([self sshHost]) {
[theFavorite setObject:[self sshHost] forKey:SPFavoriteSSHHostKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSHHostKey];
}
if ([self sshUser]) {
[theFavorite setObject:[self sshUser] forKey:SPFavoriteSSHUserKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSHUserKey];
}
if ([self sshPort]) {
[theFavorite setObject:[self sshPort] forKey:SPFavoriteSSHPortKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSHPortKey];
}
[theFavorite setObject:[NSNumber numberWithInteger:[self sshKeyLocationEnabled]] forKey:SPFavoriteSSHKeyLocationEnabledKey];
if ([self sshKeyLocation]) {
[theFavorite setObject:[self sshKeyLocation] forKey:SPFavoriteSSHKeyLocationKey];
+ } else {
+ [theFavorite removeObjectForKey:SPFavoriteSSHKeyLocationKey];
}