aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-10-24 14:33:44 +0200
committerMax <post@wickenrode.com>2015-10-24 14:33:44 +0200
commite7cf9cde835a3db7921a96da063b908c0084a43f (patch)
treeb7ee568374d71395b3c3432f835e83e49fc60261 /Source
parent6f8243138865f4121f3bfd38f18fd8004b66c218 (diff)
downloadsequelpro-e7cf9cde835a3db7921a96da063b908c0084a43f.tar.gz
sequelpro-e7cf9cde835a3db7921a96da063b908c0084a43f.tar.bz2
sequelpro-e7cf9cde835a3db7921a96da063b908c0084a43f.zip
Fix table name token not being used in SQL exports even when only one table is selected
Diffstat (limited to 'Source')
-rw-r--r--Source/SPExportFilenameUtilities.m2
-rw-r--r--Source/SPExportInitializer.m3
2 files changed, 4 insertions, 1 deletions
diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m
index e71ede3b..ac09dd3b 100644
--- a/Source/SPExportFilenameUtilities.m
+++ b/Source/SPExportFilenameUtilities.m
@@ -149,6 +149,8 @@
}
[exportCustomFilenameTokenPool setObjectValue:exportTokens];
+ //update preview name as programmatically changing the exportCustomFilenameTokenField does not fire a notification
+ [self updateDisplayedExportFilename];
}
/**
diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m
index 03284525..1b9fb5a8 100644
--- a/Source/SPExportInitializer.m
+++ b/Source/SPExportInitializer.m
@@ -304,7 +304,8 @@
[sqlExporter setSqlExportTables:exportTables];
// Create custom filename if required
- [exportFilename setString:(createCustomFilename) ? [self expandCustomFilenameFormatUsingTableName:nil] : [self generateDefaultExportFilename]];
+ NSString *selectedTableName = (exportSource == SPTableExport && [exportTables count] == 1)? [[exportTables objectAtIndex:0] objectAtIndex:0] : nil;
+ [exportFilename setString:(createCustomFilename) ? [self expandCustomFilenameFormatUsingTableName:selectedTableName] : [self generateDefaultExportFilename]];
// Only append the extension if necessary
if (![[exportFilename pathExtension] length]) {