From eb65e7845ea93a0200b304bd63f88415762fa29a Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 25 May 2012 08:20:29 +0000 Subject: Export tidy up. --- Source/SPCSVExporterDelegate.m | 14 -------------- Source/SPDotExporterDelegate.m | 17 +---------------- Source/SPExportController.h | 4 ++-- Source/SPExportController.m | 4 ++-- Source/SPExportFile.h | 1 + Source/SPExportInitializer.m | 12 ++++++------ Source/SPExporter.h | 1 - Source/SPHTMLExporterDelegate.m | 18 +++--------------- Source/SPPDFExporterDelegate.m | 16 ++-------------- Source/SPSQLExporterDelegate.m | 18 ++---------------- Source/SPXMLExporterDelegate.m | 13 +------------ 11 files changed, 20 insertions(+), 98 deletions(-) diff --git a/Source/SPCSVExporterDelegate.m b/Source/SPCSVExporterDelegate.m index 6f8e06f6..019152b5 100644 --- a/Source/SPCSVExporterDelegate.m +++ b/Source/SPCSVExporterDelegate.m @@ -23,8 +23,6 @@ // // More info at -#import - #import "SPCSVExporter.h" #import "SPCSVExporterDelegate.h" #import "SPDatabaseDocument.h" @@ -32,9 +30,6 @@ @implementation SPExportController (SPCSVExporterDelegate) -/** - * - */ - (void)csvExportProcessWillBegin:(SPCSVExporter *)exporter { [[exportProgressText onMainThread] displayIfNeeded]; @@ -57,9 +52,6 @@ [[exportProgressText onMainThread] displayIfNeeded]; } -/** - * - */ - (void)csvExportProcessComplete:(SPCSVExporter *)exporter { NSUInteger exportCount = [exporters count]; @@ -108,9 +100,6 @@ } } -/** - * - */ - (void)csvExportProcessWillBeginWritingData:(SPCSVExporter *)exporter { // Only update the progress text if this is a table export @@ -129,9 +118,6 @@ [[exportProgressIndicator onMainThread] setDoubleValue:0]; } -/** - * - */ - (void)csvExportProcessProgressUpdated:(SPCSVExporter *)exporter { [exportProgressIndicator setDoubleValue:[exporter exportProgressValue]]; diff --git a/Source/SPDotExporterDelegate.m b/Source/SPDotExporterDelegate.m index 2d1e4b46..2ed60126 100644 --- a/Source/SPDotExporterDelegate.m +++ b/Source/SPDotExporterDelegate.m @@ -29,9 +29,6 @@ @implementation SPExportController (SPDotExporterDelegate) -/** - * - */ - (void)dotExportProcessWillBegin:(SPDotExporter *)exporter { [[exportProgressTitle onMainThread] setStringValue:NSLocalizedString(@"Exporting Dot File", @"text showing that the application is exporting a Dot file")]; @@ -43,9 +40,6 @@ [[exportProgressIndicator onMainThread] setIndeterminate:NO]; } -/** - * - */ - (void)dotExportProcessComplete:(SPDotExporter *)exporter { [NSApp endSheet:exportProgressWindow returnCode:0]; @@ -54,23 +48,17 @@ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode]; // Restore the connection encoding to it's pre-export value - [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", sqlPreviousConnectionEncoding, (sqlPreviousConnectionEncodingViaLatin1) ? @"-" : @""] reloadingViews:NO]; + [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", previousConnectionEncoding, (previousConnectionEncodingViaLatin1) ? @"-" : @""] reloadingViews:NO]; // Display Growl notification [self displayExportFinishedGrowlNotification]; } -/** - * - */ - (void)dotExportProcessProgressUpdated:(SPDotExporter *)exporter { [exportProgressIndicator setDoubleValue:[exporter exportProgressValue]]; } -/** - * - */ - (void)dotExportProcessWillBeginFetchingData:(SPDotExporter *)exporter forTableWithIndex:(NSUInteger)tableIndex { // Update the current table export index @@ -81,9 +69,6 @@ [exportProgressText displayIfNeeded]; } -/** - * - */ - (void)dotExportProcessWillBeginFetchingRelationsData:(SPDotExporter *)exporter { [[exportProgressText onMainThread] setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Table %lu of %lu (%@): Fetching relations data...", @"export label showing app is fetching relations data for a specific table"), currentTableExportIndex, exportTableCount, [exporter dotExportCurrentTable]]]; diff --git a/Source/SPExportController.h b/Source/SPExportController.h index 72a12a85..fd5455fd 100644 --- a/Source/SPExportController.h +++ b/Source/SPExportController.h @@ -210,12 +210,12 @@ /** * Previous connection encoding */ - NSString *sqlPreviousConnectionEncoding; + NSString *previousConnectionEncoding; /** * Previous connection encoding was via Latin1 */ - BOOL sqlPreviousConnectionEncodingViaLatin1; + BOOL previousConnectionEncodingViaLatin1; /** * The server's lower_case_table_names setting diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 315df604..5b8b034e 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -95,7 +95,7 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; exportTypeLabel = @""; createCustomFilename = NO; - sqlPreviousConnectionEncodingViaLatin1 = NO; + previousConnectionEncodingViaLatin1 = NO; tables = [[NSMutableArray alloc] init]; exporters = [[NSMutableArray alloc] init]; @@ -723,7 +723,7 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; [operationQueue release], operationQueue = nil; [exportFilename release], exportFilename = nil; - if (sqlPreviousConnectionEncoding) [sqlPreviousConnectionEncoding release], sqlPreviousConnectionEncoding = nil; + if (previousConnectionEncoding) [previousConnectionEncoding release], previousConnectionEncoding = nil; [super dealloc]; } diff --git a/Source/SPExportFile.h b/Source/SPExportFile.h index 38f60429..eab05f9b 100644 --- a/Source/SPExportFile.h +++ b/Source/SPExportFile.h @@ -81,4 +81,5 @@ - (void)writeData:(NSData *)data; - (SPExportFileHandleStatus)createExportFileHandle:(BOOL)overwrite; - (void)setCompressionFormat:(SPFileCompressionFormat)fileCompressionFormat; + @end diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 4cad22ba..d9ce4ecb 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -85,7 +85,7 @@ NSArray *dataArray = nil; // Get rid of the cached connection encoding - if (sqlPreviousConnectionEncoding) [sqlPreviousConnectionEncoding release], sqlPreviousConnectionEncoding = nil; + if (previousConnectionEncoding) [previousConnectionEncoding release], previousConnectionEncoding = nil; createCustomFilename = ([[exportCustomFilenameTokenField stringValue] length] > 0); @@ -282,8 +282,8 @@ [sqlExporter setSqlInsertDivider:[exportSQLInsertDividerPopUpButton indexOfSelectedItem]]; // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work - sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; - sqlPreviousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; + previousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; + previousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; [tableDocumentInstance setConnectionEncoding:@"utf8" reloadingViews:NO]; @@ -381,9 +381,9 @@ [dotExporter setDotDatabaseName:[tableDocumentInstance database]]; [dotExporter setDotDatabaseVersion:[tableDocumentInstance mySQLVersion]]; - // Cache the current connection encoding then change it to UTF-8 to allow SQL dumps to work - sqlPreviousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; - sqlPreviousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; + // Cache the current connection encoding then change it to UTF-8 to allow dumps to work + previousConnectionEncoding = [[NSString alloc] initWithString:[connection encoding]]; + previousConnectionEncodingViaLatin1 = [connection encodingUsesLatin1Transport]; [tableDocumentInstance setConnectionEncoding:@"utf8" reloadingViews:NO]; diff --git a/Source/SPExporter.h b/Source/SPExporter.h index e58c8d65..a4af52d3 100644 --- a/Source/SPExporter.h +++ b/Source/SPExporter.h @@ -61,7 +61,6 @@ BOOL exportUsingLowMemoryBlockingStreaming; BOOL exportOutputCompressFile; - SPFileCompressionFormat exportOutputCompressionFormat; NSString *exportData; diff --git a/Source/SPHTMLExporterDelegate.m b/Source/SPHTMLExporterDelegate.m index e4f02180..daafcd6b 100644 --- a/Source/SPHTMLExporterDelegate.m +++ b/Source/SPHTMLExporterDelegate.m @@ -27,28 +27,16 @@ @implementation SPExportController (SPHTMLExporterDelegate) -/** - * - */ - (void)htmlExportProcessWillBegin:(SPHTMLExporter *)exporter -{ - +{ } -/** - * - */ - (void)htmlExportProcessComplete:(SPHTMLExporter *)exporter -{ - +{ } -/** - * - */ - (void)htmlExportProcessWillBeginWritingData:(SPHTMLExporter *)exporter -{ - +{ } @end diff --git a/Source/SPPDFExporterDelegate.m b/Source/SPPDFExporterDelegate.m index e838adee..d2c78544 100644 --- a/Source/SPPDFExporterDelegate.m +++ b/Source/SPPDFExporterDelegate.m @@ -27,28 +27,16 @@ @implementation SPExportController (SPPDFExporterDelegate) -/** - * - */ - (void)pdfExportProcessWillBegin:(SPPDFExporter *)exporter { - } -/** - * - */ - (void)pdfExportProcessComplete:(SPPDFExporter *)exporter -{ - +{ } -/** - * - */ - (void)pdfExportProcessWillBeginWritingData:(SPPDFExporter *)exporter -{ - +{ } @end diff --git a/Source/SPSQLExporterDelegate.m b/Source/SPSQLExporterDelegate.m index 89bc9b89..669d2563 100644 --- a/Source/SPSQLExporterDelegate.m +++ b/Source/SPSQLExporterDelegate.m @@ -29,9 +29,6 @@ @implementation SPExportController (SPSQLExporterDelegate) -/** - * - */ - (void)sqlExportProcessWillBegin:(SPSQLExporter *)exporter { [[exportProgressTitle onMainThread] setStringValue:NSLocalizedString(@"Exporting SQL", @"text showing that the application is exporting SQL")]; @@ -41,9 +38,6 @@ [[exportProgressText onMainThread] displayIfNeeded]; } -/** - * - */ - (void)sqlExportProcessComplete:(SPSQLExporter *)exporter { [exportProgressIndicator stopAnimation:self]; @@ -53,7 +47,7 @@ [tableDocumentInstance setQueryMode:SPInterfaceQueryMode]; // Restore the connection encoding to it's pre-export value - [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", sqlPreviousConnectionEncoding, (sqlPreviousConnectionEncodingViaLatin1) ? @"-" : @""] reloadingViews:NO]; + [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", previousConnectionEncoding, (previousConnectionEncodingViaLatin1) ? @"-" : @""] reloadingViews:NO]; // Display Growl notification [self displayExportFinishedGrowlNotification]; @@ -64,21 +58,16 @@ } } -/** - * - */ - (void)sqlExportProcessProgressUpdated:(SPSQLExporter *)exporter { if ([exportProgressIndicator doubleValue] == 0) { [exportProgressIndicator stopAnimation:self]; [exportProgressIndicator setIndeterminate:NO]; } + [exportProgressIndicator setDoubleValue:[exporter exportProgressValue]]; } -/** - * - */ - (void)sqlExportProcessWillBeginFetchingData:(SPSQLExporter *)exporter { [exportProgressText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Table %lu of %lu (%@): Fetching data...", @"export label showing that the app is fetching data for a specific table"), [exporter sqlCurrentTableExportIndex], exportTableCount, [exporter sqlExportCurrentTable]]]; @@ -89,9 +78,6 @@ [exportProgressIndicator setDoubleValue:0]; } -/** - * - */ - (void)sqlExportProcessWillBeginWritingData:(SPSQLExporter *)exporter { [exportProgressText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Table %lu of %lu (%@): Writing data...", @"export label showing app if writing data for a specific table"), [exporter sqlCurrentTableExportIndex], exportTableCount, [exporter sqlExportCurrentTable]]]; diff --git a/Source/SPXMLExporterDelegate.m b/Source/SPXMLExporterDelegate.m index 8b1d9e73..33c039ff 100644 --- a/Source/SPXMLExporterDelegate.m +++ b/Source/SPXMLExporterDelegate.m @@ -27,13 +27,11 @@ #import "SPXMLExporter.h" #import "SPDatabaseDocument.h" #import "SPExportFile.h" + #import @implementation SPExportController (SPXMLExporterDelegate) -/** - * - */ - (void)xmlExportProcessWillBegin:(SPXMLExporter *)exporter { [[exportProgressText onMainThread] displayIfNeeded]; @@ -57,9 +55,6 @@ [[exportProgressText onMainThread] displayIfNeeded]; } -/** - * - */ - (void)xmlExportProcessComplete:(SPXMLExporter *)exporter { NSUInteger exportCount = [exporters count]; @@ -114,17 +109,11 @@ } } -/** - * - */ - (void)xmlExportProcessProgressUpdated:(SPXMLExporter *)exporter { [[exportProgressIndicator onMainThread] setDoubleValue:[exporter exportProgressValue]]; } -/** - * - */ - (void)xmlExportProcessWillBeginWritingData:(SPXMLExporter *)exporter { // Only update the progress text if this is a table export -- cgit v1.2.3