From c468b8111a15b89e4801eb89dd217392e0d4a347 Mon Sep 17 00:00:00 2001 From: avenjamin Date: Wed, 13 May 2009 03:24:20 +0000 Subject: Fixes issues #255 and #257 - Favorites list in connection sheet was moving bottom grey border when scrolling. (#255) - Missing keys for a favorite item were return NULL values causing field values from previously selected favorite to remain. (#257) --- Source/TableDocument.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Source') diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 6a769996..3c02e687 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -390,13 +390,13 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum if (![self selectedFavorite]) return; - [nameField setStringValue:[self valueForKeyPath:@"selectedFavorite.name"]]; - [hostField setStringValue:[self valueForKeyPath:@"selectedFavorite.host"]]; - [socketField setStringValue:[self valueForKeyPath:@"selectedFavorite.socket"]]; - [userField setStringValue:[self valueForKeyPath:@"selectedFavorite.user"]]; - [portField setStringValue:[self valueForKeyPath:@"selectedFavorite.port"]]; - [databaseField setStringValue:[self valueForKeyPath:@"selectedFavorite.database"]]; - [passwordField setStringValue:[self selectedFavoritePassword]]; + [nameField setStringValue:([self valueForKeyPath:@"selectedFavorite.name"] ? [self valueForKeyPath:@"selectedFavorite.name"] : @"")]; + [hostField setStringValue:([self valueForKeyPath:@"selectedFavorite.host"] ? [self valueForKeyPath:@"selectedFavorite.host"] : @"")]; + [userField setStringValue:([self valueForKeyPath:@"selectedFavorite.user"] ? [self valueForKeyPath:@"selectedFavorite.user"] : @"")]; + [passwordField setStringValue:([self selectedFavoritePassword] ? [self selectedFavoritePassword] : @"")]; + [databaseField setStringValue:([self valueForKeyPath:@"selectedFavorite.database"] ? [self valueForKeyPath:@"selectedFavorite.database"] : @"")]; + [socketField setStringValue:([self valueForKeyPath:@"selectedFavorite.socket"] ? [self valueForKeyPath:@"selectedFavorite.socket"] : @"")]; + [portField setStringValue:([self valueForKeyPath:@"selectedFavorite.port"] ? [self valueForKeyPath:@"selectedFavorite.port"] : @"")]; [prefs setInteger:[favoritesController selectionIndex] forKey:@"LastFavoriteIndex"]; } -- cgit v1.2.3