diff options
author | rowanbeentje <rowan@beent.je> | 2012-12-14 23:05:55 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-12-14 23:05:55 +0000 |
commit | 3cfe628ecc4b51ff2e1013f2260ef5f056db8b97 (patch) | |
tree | cd8c6e1564cc30d3c31e5109658dc543d0b09db7 /Source/SPConnectionController.m | |
parent | 3b5642c68f57865888b60a1f846fed3810333dae (diff) | |
download | sequelpro-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/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 28 |
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]; } |