From d197a5157f815845e2a709d2c942c707758901ee Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 17 Jul 2010 00:53:51 +0000 Subject: Export redesign (#610) CSV filename tweaks: - Don't forcibly include the table name if only exporting a single table, even if the multiple tables checkbox is ticked - Fix additional _null files exported for Filtered Result exports when the multiple tables checkbox is ticked. Also addresses leaking write threads for those files. --- Source/SPExportInitializer.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/SPExportInitializer.m') diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index ecb61784..b674db09 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -460,7 +460,7 @@ [csvExporter setCsvNULLString:[exportCSVNULLValuesAsTextField stringValue]]; // If required create separate files - if ([self exportToMultipleFiles]) { + if (exportSource == SPTableExport && [self exportToMultipleFiles]) { if (createCustomFilename) { @@ -469,7 +469,9 @@ // If the user chose to use a custom filename format and we exporting to multiple files, make // sure the table name is included to ensure the output files are unique. - [exportFilename setString:([[exportCustomFilenameTokenField stringValue] rangeOfString:@"table" options:NSLiteralSearch].location == NSNotFound) ? [exportFilename stringByAppendingFormat:@"_%@", table] : exportFilename]; + if (exportTableCount > 1) { + [exportFilename setString:([[exportCustomFilenameTokenField stringValue] rangeOfString:@"table" options:NSLiteralSearch].location == NSNotFound) ? [exportFilename stringByAppendingFormat:@"_%@", table] : exportFilename]; + } } else { [exportFilename setString:(dataArray) ? [tableDocumentInstance database] : table]; -- cgit v1.2.3