diff options
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]; |