diff options
author | stuconnolly <stuart02@gmail.com> | 2009-10-26 23:30:09 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-10-26 23:30:09 +0000 |
commit | 332c2308514c1c0fe839dd0124d90cd8d24fd9ef (patch) | |
tree | 77f4245d2c9d0f0e47577ef563c57e9902c067a4 /Source | |
parent | e7b2c58d61b3a815de977d0266749197b03b330c (diff) | |
download | sequelpro-332c2308514c1c0fe839dd0124d90cd8d24fd9ef.tar.gz sequelpro-332c2308514c1c0fe839dd0124d90cd8d24fd9ef.tar.bz2 sequelpro-332c2308514c1c0fe839dd0124d90cd8d24fd9ef.zip |
Minor export work.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPCSVExporter.h | 2 | ||||
-rw-r--r-- | Source/SPExportController.h | 4 | ||||
-rw-r--r-- | Source/SPExportController.m | 19 | ||||
-rw-r--r-- | Source/SPExporter.m | 2 |
4 files changed, 18 insertions, 9 deletions
diff --git a/Source/SPCSVExporter.h b/Source/SPCSVExporter.h index b0edc04e..5c78be04 100644 --- a/Source/SPCSVExporter.h +++ b/Source/SPCSVExporter.h @@ -31,7 +31,7 @@ @interface SPCSVExporter : SPExporter { // CSV data - NSArray *csvDataArray; + NSArray *csvDataArray; MCPStreamingResult *csvDataResult; // CSV options diff --git a/Source/SPExportController.h b/Source/SPExportController.h index 16d176b3..b1c50933 100644 --- a/Source/SPExportController.h +++ b/Source/SPExportController.h @@ -119,6 +119,10 @@ typedef NSUInteger SPExportSource; // Concurrent operation queue NSOperationQueue *operationQueue; + + // Table/export operation mapping + NSMutableDictionary *tableExportMapping; + } @property (readwrite, assign) BOOL exportCancelled; diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 19d794ae..d7c0882f 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -34,7 +34,7 @@ @interface SPExportController (PrivateAPI) - (void)_initializeExportUsingSelectedOptions; -- (BOOL)_exportTables:(NSArray *)exportTables asType:(SPExportType)type; +- (BOOL)_exportTables:(NSArray *)exportTables asType:(SPExportType)type toMultipleFiles:(BOOL)multipleFiles; @end @@ -53,6 +53,7 @@ tables = [[NSMutableArray alloc] init]; operationQueue = [[NSOperationQueue alloc] init]; + tableExportMapping = [NSMutableDictionary dictionary]; } return self; @@ -336,7 +337,7 @@ break; case SP_TABLE_EXPORT: - [self _exportTables:exportTables asType:exportType]; + [self _exportTables:exportTables asType:exportType toMultipleFiles:[exportFilePerTableCheck state]]; break; } } @@ -345,15 +346,14 @@ * Exports the contents' of the supplied array of tables. Note that this method currently only supports * exporting in CSV and XML formats. */ -- (BOOL)_exportTables:(NSArray *)exportTables asType:(SPExportType)type +- (BOOL)_exportTables:(NSArray *)exportTables asType:(SPExportType)type toMultipleFiles:(BOOL)multipleFiles { NSUInteger i; NSMutableString *errors = [NSMutableString string]; - NSMutableString *infoString = [NSMutableString string]; NSDictionary *tableDetails; - NSStringEncoding encoding = [[self connection] encoding]; + //NSStringEncoding encoding = [[self connection] encoding]; // Reset the interface [exportProgressTitle setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Exporting %@", @"text showing that the application is importing a supplied format"), @"CSV"]]; @@ -384,12 +384,17 @@ options:NSLiteralSearch range:NSMakeRange(0, [csvLineEnd length])]; + NSUInteger tableCount = [exportTables count]; + + // If + if ((type == SP_CSV_EXPORT) && (!multipleFiles) && (tableCount > 1)) { + + } + /*if ([exportTables count] > 1) { [infoString setString:[NSString stringWithFormat:@"Host: %@ Database: %@ Generation Time: %@%@%@", [tableDocumentInstance host], [tableDocumentInstance database], [NSDate date], csvLineEnd, csvLineEnd]]; }*/ - - NSUInteger tableCount = [exportTables count]; // Loop through the tables for (i = 0 ; i < tableCount; i++) diff --git a/Source/SPExporter.m b/Source/SPExporter.m index a1fe448b..cf764b61 100644 --- a/Source/SPExporter.m +++ b/Source/SPExporter.m @@ -58,7 +58,7 @@ } /** - * + * Override NSOperation's main() method. This method should never be called as all subclasses should override it. */ - (void)main { |