diff options
author | stuconnolly <stuart02@gmail.com> | 2012-04-29 10:08:52 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-04-29 10:08:52 +0000 |
commit | fb3b03a7d96870cc3829a8c1d01b37267866e8e7 (patch) | |
tree | 6ec3239fcdf8085273c53359e0a6ea58ed421706 /Source/SPExportFilenameUtilities.m | |
parent | 4cad6f0e6e4fb497b480256c2abe3de34ebf225c (diff) | |
download | sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.tar.gz sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.tar.bz2 sequelpro-fb3b03a7d96870cc3829a8c1d01b37267866e8e7.zip |
Bring outline view branch up to date with trunk (r3586:r3592).
Diffstat (limited to 'Source/SPExportFilenameUtilities.m')
-rw-r--r-- | Source/SPExportFilenameUtilities.m | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m index ad5ab36b..1f37a561 100644 --- a/Source/SPExportFilenameUtilities.m +++ b/Source/SPExportFilenameUtilities.m @@ -65,32 +65,38 @@ BOOL isCSV = exportType == SPCSVExport; BOOL isDot = exportType == SPDotExport; BOOL isXML = exportType == SPXMLExport; - - NSString *tokens = NSLocalizedString(@"host,database,table,date,year,month,day,time", @"default custom export filename tokens");; - NSString *tokensWithoutTable = NSLocalizedString(@"host,database,date,year,month,day,time", @"custom export filename tokens without table"); - + + NSMutableArray *exportTokens = [NSMutableArray arrayWithObjects: + NSLocalizedString(@"host", @"export filename host token"), + NSLocalizedString(@"database", @"export filename database token"), + NSLocalizedString(@"table", @"table"), + NSLocalizedString(@"date", @"export filename date token"), + NSLocalizedString(@"year", @"export filename date token"), + NSLocalizedString(@"month", @"export filename date token"), + NSLocalizedString(@"day", @"export filename date token"), + NSLocalizedString(@"time", @"export filename time token"), + nil]; + + // Determine whether to remove the table from the tokens list if (exportSource == SPQueryExport || isDot) { - tokens = tokensWithoutTable; + removeTable = YES; } else if (isSQL || isCSV || isXML) { for (NSArray *table in tables) { if ([NSArrayObjectAtIndex(table, 2) boolValue]) { i++; - removeTable = YES; - if (i == 2) break; } } if (i > 1) { removeTable = isSQL ? YES : ![exportFilePerTableCheck state]; - - tokens = isSQL ? tokensWithoutTable : ([exportFilePerTableCheck state] ? tokens : tokensWithoutTable); } } if (removeTable) { + [exportTokens removeObject:NSLocalizedString(@"table", @"table")]; NSArray *tokenParts = [exportCustomFilenameTokenField objectValue]; for (id token in [exportCustomFilenameTokenField objectValue]) @@ -107,8 +113,8 @@ } } } - - [exportCustomFilenameTokensField setStringValue:tokens]; + + [exportCustomFilenameTokensField setStringValue:[exportTokens componentsJoinedByString:@","]]; } /** |