diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-11 17:48:49 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-11 17:48:49 +0000 |
commit | 967136fd591a7f13185a0b353827bf8946883fc8 (patch) | |
tree | 16fe5d71b6591af1d05711fd0856e771759fb832 /Source/TableDocument.m | |
parent | c89861651e5505652446daad6861156986683370 (diff) | |
download | sequelpro-967136fd591a7f13185a0b353827bf8946883fc8.tar.gz sequelpro-967136fd591a7f13185a0b353827bf8946883fc8.tar.bz2 sequelpro-967136fd591a7f13185a0b353827bf8946883fc8.zip |
• further preparations to F5 completion
Note: not yet active - only querying the data in background will be performed for testing
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 30645361..2bd178e7 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -681,7 +681,7 @@ notificationName:@"Connected"]; // Query the structure of all databases in the background (mainly for completion) - [mySQLConnection performSelector:@selector(queryDbStructure) withObject:nil afterDelay:0.1]; + // [mySQLConnection performSelector:@selector(queryDbStructure) withObject:nil afterDelay:2]; // Init Custom Query editor with the stored queries in a spf file if given. [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; @@ -914,10 +914,11 @@ if ([queryResult numOfRows]) [queryResult dataSeek:0]; if (allDatabases) [allDatabases release]; + if (allSystemDatabases) [allSystemDatabases release]; allDatabases = [[NSMutableArray alloc] initWithCapacity:[queryResult numOfRows]]; - NSMutableArray *systemDatabases = [NSMutableArray array]; + allSystemDatabases = [[NSMutableArray alloc] initWithCapacity:2]; for (NSInteger i = 0 ; i < [queryResult numOfRows] ; i++) { @@ -925,7 +926,7 @@ // If the database is either information_schema or mysql then it is classed as a system table if ([database isEqualToString:@"information_schema"] || [database isEqualToString:@"mysql"]) { - [systemDatabases addObject:database]; + [allSystemDatabases addObject:database]; } else { [allDatabases addObject:database]; @@ -933,13 +934,13 @@ } // Add system databases - for (NSString *db in systemDatabases) + for (NSString *db in allSystemDatabases) { [chooseDatabaseButton addItemWithTitle:db]; } // Add a separator between the system and user databases - if ([systemDatabases count] > 0) { + if ([allSystemDatabases count] > 0) { [[chooseDatabaseButton menu] addItem:[NSMenuItem separatorItem]]; } @@ -1115,6 +1116,14 @@ } /** + * Returns an array of all available system database names + */ +- (NSArray *)allSystemDatabaseNames +{ + return allSystemDatabases; +} + +/** * Alert sheet method. Invoked when an alert sheet is dismissed. * * if contextInfo == removeDatabase -> Remove the selected database @@ -3599,6 +3608,7 @@ { [_encoding release]; [allDatabases release]; + [allSystemDatabases release]; [printWebView release]; if (connectionController) [connectionController release]; |