diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-26 19:23:18 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-26 19:23:18 +0000 |
commit | f5edb22564ec1c3e834f20fd080a84ce581acfe4 (patch) | |
tree | af955d775594cd3713772c2d343111f270f94b91 /Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | |
parent | 1c3c288b8cc26d8de7119e3fff9b1ad60c9ee63a (diff) | |
download | sequelpro-f5edb22564ec1c3e834f20fd080a84ce581acfe4.tar.gz sequelpro-f5edb22564ec1c3e834f20fd080a84ce581acfe4.tar.bz2 sequelpro-f5edb22564ec1c3e834f20fd080a84ce581acfe4.zip |
• navigator
- fixed issue if different connection windows are connected to the same connection
- prepared structure querying method to be able to add user info containing which table/db was changed if we know it to reduce the future parsing cost
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m')
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index e2a2930f..7b6fa0b8 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -1834,7 +1834,7 @@ void performThreadedKeepAlive(void *ptr) * Updates the dict containing the structure of all available databases (mainly for completion/navigator) * executed on a new connection. */ -- (void)queryDbStructureAndForceUpdate:(NSNumber*)forceUpdate +- (void)queryDbStructureWithUserInfo:(NSDictionary*)userInfo { NSAutoreleasePool *queryPool = [[NSAutoreleasePool alloc] init]; @@ -1842,6 +1842,8 @@ void performThreadedKeepAlive(void *ptr) NSString *SPUniqueSchemaDelimiter = @""; + + NSString *connectionID; if([delegate respondsToSelector:@selector(connectionID)]) connectionID = [NSString stringWithString:[[self delegate] connectionID]]; @@ -1858,9 +1860,8 @@ void performThreadedKeepAlive(void *ptr) [[[self delegate] allDatabaseNames] componentsJoinedByString:SPUniqueSchemaDelimiter]] componentsSeparatedByString:SPUniqueSchemaDelimiter]; for(id db in dbs) { - NSString *db_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, db]; - if(![[structure valueForKey:connectionID] valueForKey:db_id]) { - [[structure valueForKey:connectionID] setObject:db forKey:db_id]; + if(![[self delegate] navigatorSchemaPathExistsForDatabase:db]) { + [[structure valueForKey:connectionID] setObject:db forKey:[NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, db]]; } } @@ -1907,7 +1908,7 @@ void performThreadedKeepAlive(void *ptr) } } - if(forceUpdate == nil) { + if(userInfo == nil || ![userInfo objectForKey:@"forceUpdate"]) { if([[self delegate] navigatorSchemaPathExistsForDatabase:currentDatabase]) { if(removeFlag) [[NSNotificationCenter defaultCenter] postNotificationName:@"SPDBStructureWasUpdated" object:delegate]; |