aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNavigatorController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-31 19:47:19 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-31 19:47:19 +0000
commit836b96f7e1481938c0267448b940b5d8e202eb09 (patch)
tree3fc5ca7d44acbac56c73270779d05a93c8411db8 /Source/SPNavigatorController.m
parent841c9a5e1fc35a6aa2cb0d488057f504c1c9b378 (diff)
downloadsequelpro-836b96f7e1481938c0267448b940b5d8e202eb09.tar.gz
sequelpro-836b96f7e1481938c0267448b940b5d8e202eb09.tar.bz2
sequelpro-836b96f7e1481938c0267448b940b5d8e202eb09.zip
• ensure that the global schema structure data for completion are updated even if SP is not active
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