From 6c80b88f3c29b76fec560589e67920a99681723a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 15 Apr 2009 21:26:42 +0000 Subject: - Tweak favorites/keychain upgrade routine to only fire once, even if going back and testing older releases/revisions --- Source/SPPreferenceController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index d5c34db2..dc4b98c7 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -195,7 +195,8 @@ // Cycle through the favorites, generating a timestamp-derived ID for each and renaming associated keychain items. for (i = 0; i < [favoritesArray count]; i++) { - favorite = [favoritesArray objectAtIndex:i]; + favorite = [favoritesArray objectAtIndex:i]; + if ([favorite objectForKey:@"id"]) continue; [favorite setObject:[NSNumber numberWithInt:[[NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]] hash]] forKey:@"id"]; keychainName = [NSString stringWithFormat:@"Sequel Pro : %@", [favorite objectForKey:@"name"]]; keychainAccount = [NSString stringWithFormat:@"%@@%@/%@", @@ -524,7 +525,7 @@ // tableViewSelectionDidChange: // ------------------------------------------------------------------------------- - (void)tableViewSelectionDidChange:(NSNotification *)notification -{ +{ if ([[favoritesTableView selectedRowIndexes] count] > 0) { [favoritesController setSelectionIndexes:[favoritesTableView selectedRowIndexes]]; } -- cgit v1.2.3