aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDump.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index ccdda6ee..3d742b6f 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -36,6 +36,7 @@
#import "SPArrayAdditions.h"
#import "RegexKitLite.h"
+
@implementation TableDump
//IBAction methods
@@ -52,15 +53,26 @@
queryResult = (MCPResult *)[mySQLConnection listTables];
if ([queryResult numOfRows]) [queryResult dataSeek:0];
+ NSMutableArray *unsortedTables = [NSMutableArray array];
for ( i = 0 ; i < [queryResult numOfRows] ; i++ ) {
- [tables addObject:[NSMutableArray arrayWithObjects:
- [NSNumber numberWithBool:YES], NSArrayObjectAtIndex([queryResult fetchRowAsArray], 0), nil]];
+ [unsortedTables addObject:[[queryResult fetchRowAsArray] objectAtIndex:0]];
}
+ NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)];
+ NSArray *sortedTables = [unsortedTables sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]];
+ [desc release];
+
+ for ( i = 0 ; i < [sortedTables count]; i++ ) {
+ [tables addObject:
+ [NSMutableArray arrayWithObjects:
+ [NSNumber numberWithBool:YES],
+ [sortedTables objectAtIndex:i],
+ nil]];
+ }
+
[exportDumpTableView reloadData];
[exportMultipleCSVTableView reloadData];
[exportMultipleXMLTableView reloadData];
-
}
- (IBAction)selectTables:(id)sender