aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-07-17 00:53:51 +0000
committerrowanbeentje <rowan@beent.je>2010-07-17 00:53:51 +0000
commitd197a5157f815845e2a709d2c942c707758901ee (patch)
treeddee618a7dcf8aa29afdf38f4a8b3842b96807c4
parent55c888287eb9520437eb267567c6a325d796efbb (diff)
downloadsequelpro-d197a5157f815845e2a709d2c942c707758901ee.tar.gz
sequelpro-d197a5157f815845e2a709d2c942c707758901ee.tar.bz2
sequelpro-d197a5157f815845e2a709d2c942c707758901ee.zip
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.
-rw-r--r--Source/SPExportInitializer.m6
1 files changed, 4 insertions, 2 deletions
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];