From 1f0dde0452519496a3d361ad6ddb38731c350a7e Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 27 May 2012 22:33:26 +0000 Subject: Improve connection handling and editing: - Fix long-standing intermittent crashes caused by connection errors after SSH tunnels were established - Fix edits causing keychain -25299 errors (Issue #1340) - Allow changes of favourite type to be saved rather than disassociating the edit from the selection - Fix the favourites view scrolling to the top when there's no selection and connection details are being edited - Fix some issues with automatic naming of connections on connection type change --- Source/SPConnectionController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/SPConnectionController.m') diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 212df1da..68d7bb16 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -468,7 +468,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, */ - (void)updateFavoriteSelection:(id)sender { - automaticFavoriteSelection = YES; // Clear the keychain referral items as appropriate if (connectionKeychainID) [connectionKeychainID release], connectionKeychainID = nil; @@ -1218,7 +1217,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } // Update the name for newly added favorites if not already touched by the user, by triggering a KVO update - if (!favoriteNameFieldWasTouched) { + if (![[self name] length]) { [self setName:[NSString stringWithFormat:@"%@@%@", ([favorite objectForKey:SPFavoriteUserKey]) ? [favorite objectForKey:SPFavoriteUserKey] : @"", ((previousType == SPSocketConnection) ? @"localhost" : @@ -1290,6 +1289,10 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, */ - (void)_scrollToSelectedNode { + + // Don't scroll if no node is currently selected + if ([favoritesOutlineView selectedRow] == -1) return; + [favoritesOutlineView scrollRowToVisible:[favoritesOutlineView selectedRow]]; } -- cgit v1.2.3