From 1ddc896d2f88bea86e4b0457d63f7a53b846851d Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 24 Mar 2010 02:30:55 +0000 Subject: - Add a new selectDatabase:item: method to TableDocument, to centralise code for selecting databases and tables. Clean up database selection to use this new method, and avoid reloads when re-selecting the same database. - Convert the history controller to use this new call. This fixes history behaviour when a table list filter was active. - Convert the (hidden) navigator to use this new call. This fixes timing issues. - Make some thread safety tweaks to TablesList. - Change TablesList selectTableOrViewWithName: to selectItemWithName:, including procs etc. --- Source/SPNavigatorController.m | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'Source/SPNavigatorController.m') diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index f0d8961a..757797ee 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -666,16 +666,8 @@ static SPNavigatorController *sharedNavigatorController = nil; } if([[doc connectionID] isEqualToString:[pathArray objectAtIndex:0]]) { - // select db - if(![[doc database] isEqualToString:[pathArray objectAtIndex:1]]) { - if([[doc valueForKeyPath:@"mySQLConnection"] isConnected]) { - [[doc valueForKeyPath:@"chooseDatabaseButton"] selectItemWithTitle:[pathArray objectAtIndex:1]]; - [doc chooseDatabase:self]; - } - } - // select table/view if given - if([pathArray count] > 2) - [[doc valueForKeyPath:@"tablesListInstance"] performSelector:@selector(selectTableOrViewWithName:) withObject:[pathArray objectAtIndex:2] afterDelay:0.1]; + // Select the database and table + [doc selectDatabase:[pathArray objectAtIndex:1] item:([pathArray count] > 2)?[pathArray objectAtIndex:2]:nil]; } else { [SPTooltip showWithObject:NSLocalizedString(@"The connection of the active connection window is not identical.", @"the connection of the active connection window is not identical tooltip") -- cgit v1.2.3