From c1de88ac62381469ad01975c0f28e5847a65edb9 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 14 May 2011 18:43:05 +0000 Subject: Fix exceptions being thrown upon launch. --- Source/SPConnectionController.h | 3 +++ Source/SPConnectionController.m | 8 ++++++++ Source/SPDatabaseDocument.m | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'Source') diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h index e6d933ed..a1a99526 100644 --- a/Source/SPConnectionController.h +++ b/Source/SPConnectionController.h @@ -244,5 +244,8 @@ - (IBAction)importFavorites:(id)sender; - (IBAction)exportFavorites:(id)sender; +// Accessors +- (SPFavoritesOutlineView *)favoritesOutlineView; + #endif @end diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index a06637e5..0f12303f 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -997,6 +997,14 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v contextInfo:SPExportFavorites]; } +#pragma mark - +#pragma mark Accessors + +- (SPFavoritesOutlineView *)favoritesOutlineView +{ + return favoritesOutlineView; +} + #pragma mark - #pragma mark Key Value Observing diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 04d4b3f3..5a2bff92 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3981,7 +3981,7 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; // If the window is being set for the first time - connection controller is visible - update focus if (!parentWindow && !mySQLConnection) { #ifndef SP_REFACTOR - [aWindow makeFirstResponder:[connectionController valueForKey:@"favoritesTable"]]; + [aWindow makeFirstResponder:(NSView *)[connectionController favoritesOutlineView]]; #endif [connectionController performSelector:@selector(updateFavoriteSelection:) withObject:self afterDelay:0.0]; } @@ -4268,12 +4268,12 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; [self updateWindowTitle:self]; // Deselect all favorites on the connection controller - [[connectionController valueForKeyPath:@"favoritesTable"] deselectAll:connectionController]; + [[connectionController favoritesOutlineView] deselectAll:connectionController]; // Suppress the possibility to choose an other connection from the favorites // if a connection should initialized by SPF file. Otherwise it could happen // that the SPF file runs out of sync. - [[connectionController valueForKeyPath:@"favoritesTable"] setEnabled:NO]; + [[connectionController favoritesOutlineView] setEnabled:NO]; // Ensure the connection controller is set to a blank slate [connectionController setName:@""]; -- cgit v1.2.3