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 /Source | |
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 'Source')
-rw-r--r-- | Source/SPNavigatorController.m | 2 | ||||
-rw-r--r-- | Source/TableDocument.m | 9 | ||||
-rw-r--r-- | Source/TableSource.m | 4 | ||||
-rw-r--r-- | Source/TablesList.m | 10 |
4 files changed, 11 insertions, 14 deletions
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index d8772b17..c5c6463d 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -492,7 +492,7 @@ static SPNavigatorController *sharedNavigatorController = nil; if ([[[NSDocumentController sharedDocumentController] documents] count]) { for(id doc in [[NSDocumentController sharedDocumentController] documents]) { if(![[doc valueForKeyPath:@"mySQLConnection"] isConnected]) continue; - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:[doc valueForKeyPath:@"mySQLConnection"] withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:[doc valueForKeyPath:@"mySQLConnection"] withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } } diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 8663cc21..7725ee1c 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -688,9 +688,6 @@ window:tableWindow notificationName:@"Connected"]; - // // Query the structure of all databases in the background (mainly for completion) - // [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:nil]; - // Init Custom Query editor with the stored queries in a spf file if given. [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; if(spfSession != nil && [spfSession objectForKey:@"queries"]) { @@ -1025,7 +1022,7 @@ [self _addDatabase]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } else { // reset chooseDatabaseButton @@ -4104,7 +4101,7 @@ [allDatabases removeObject:[self database]]; // This only deletes the db and refreshes the navigator since nothing is changed // that's why we can run this on main thread - [mySQLConnection queryDbStructureAndForceUpdate:nil]; + [mySQLConnection queryDbStructureWithUserInfo:nil]; // Delete was successful if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; @@ -4196,7 +4193,7 @@ } // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:nil]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:nil]; [self endTask]; [taskPool drain]; diff --git a/Source/TableSource.m b/Source/TableSource.m index e50f7021..8ccc682e 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -205,7 +205,7 @@ [tablesListInstance setStatusRequiresReload:YES]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; [self loadTable:selectedTable]; } @@ -864,7 +864,7 @@ closes the keySheet [tablesListInstance setContentRequiresReload:YES]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; return YES; } diff --git a/Source/TablesList.m b/Source/TablesList.m index 72448495..f5d479ee 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -92,7 +92,7 @@ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:nil]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:nil]; // Select the table list for the current database. On MySQL versions after 5 this will include // views; on MySQL versions >= 5.0.02 select the "full" list to also select the table type column. @@ -1348,7 +1348,7 @@ [tableWindow setTitle:[tableDocumentInstance displaySPName]]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } #pragma mark - @@ -1928,7 +1928,7 @@ [tablesListView deselectAll:self]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } @@ -2028,7 +2028,7 @@ [self updateSelectionWithTaskString:[NSString stringWithFormat:NSLocalizedString(@"Loading %@...", @"Loading table task string"), selectedTableName]]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } else { @@ -2222,7 +2222,7 @@ [self updateSelectionWithTaskString:[NSString stringWithFormat:NSLocalizedString(@"Loading %@...", @"Loading table task string"), selectedTableName]]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadSelector:@selector(queryDbStructureAndForceUpdate:) toTarget:mySQLConnection withObject:[NSNumber numberWithBool:YES]]; + [NSThread detachNewThreadSelector:@selector(queryDbStructureWithUserInfo:) toTarget:mySQLConnection withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; } } |