aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNavigatorController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPNavigatorController.m')
-rw-r--r--Source/SPNavigatorController.m17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m
index 0bb723ba..8261ec2b 100644
--- a/Source/SPNavigatorController.m
+++ b/Source/SPNavigatorController.m
@@ -409,15 +409,16 @@ static SPNavigatorController *sharedNavigatorController = nil;
- (void)updateNavigator:(NSNotification *)aNotification
{
+
id object = [aNotification object];
-
+
if([object isKindOfClass:[TableDocument class]])
- [self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:[object connectionID] waitUntilDone:YES];
+ [self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:object waitUntilDone:NO];
else
- [self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:nil waitUntilDone:YES];
+ [self performSelectorOnMainThread:@selector(updateEntriesForConnection:) withObject:nil waitUntilDone:NO];
}
-- (void)updateEntriesForConnection:(NSString*)connectionID
+- (void)updateEntriesForConnection:(id)doc
{
if(ignoreUpdate) {
@@ -430,15 +431,15 @@ static SPNavigatorController *sharedNavigatorController = nil;
[infoArray removeAllObjects];
}
- id doc = nil;
- if ([[[NSDocumentController sharedDocumentController] documents] count]) {
+ if (doc && [doc isKindOfClass:[TableDocument class]] && [[[NSDocumentController sharedDocumentController] documents] count]) {
- doc = [[NSDocumentController sharedDocumentController] currentDocument];
id theConnection = [doc valueForKeyPath:@"mySQLConnection"];
if(!theConnection || ![theConnection isConnected]) return;
+ NSString *connectionID = [doc connectionID];
+
NSString *connectionName = [doc connectionID];
if(!connectionName || [connectionName isEqualToString:@"_"] || (connectionID && ![connectionName isEqualToString:connectionID]) ) {
@@ -447,7 +448,6 @@ static SPNavigatorController *sharedNavigatorController = nil;
[updatingConnections addObject:connectionName];
-
if(![schemaData objectForKey:connectionName]) {
[schemaData setObject:[NSMutableDictionary dictionary] forKey:connectionName];
}
@@ -493,7 +493,6 @@ static SPNavigatorController *sharedNavigatorController = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:@"SPNavigatorStructureWasUpdated" object:doc];
-
}
- (BOOL)schemaPathExistsForConnection:(NSString*)connectionID andDatabase:(NSString*)dbname