aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableInfo.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-11-11 02:38:52 +0100
committerMax <post@wickenrode.com>2015-11-11 02:38:52 +0100
commitafd6f72c968547a0b228b02780409d8f01096da5 (patch)
treefe7a0f28b4fb950c048e47a9461d62c3ae3c31ea /Source/SPTableInfo.m
parent74a90251228a07995ea5ab1bae0fb2428f9cfbc7 (diff)
downloadsequelpro-afd6f72c968547a0b228b02780409d8f01096da5.tar.gz
sequelpro-afd6f72c968547a0b228b02780409d8f01096da5.tar.bz2
sequelpro-afd6f72c968547a0b228b02780409d8f01096da5.zip
In the table quick info section: Display shorter name for collation if it has the same prefix as encoding to save some space
Diffstat (limited to 'Source/SPTableInfo.m')
-rw-r--r--Source/SPTableInfo.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m
index 942cf63f..1767d3b0 100644
--- a/Source/SPTableInfo.m
+++ b/Source/SPTableInfo.m
@@ -192,7 +192,16 @@
}
[info addObject:[NSString stringWithFormat:NSLocalizedString(@"size: %@", @"Table Info Section : table size on disk"), [NSString stringForByteSize:[[tableStatus objectForKey:@"Data_length"] longLongValue]]]];
- [info addObject:[NSString stringWithFormat:NSLocalizedString(@"encoding: %1$@ (%2$@)", @"Table Info Section : $1 = table charset, $2 = table collation"), [tableDataInstance tableEncoding], [tableStatus objectForKey:@"Collation"]]];
+ NSString *tableEnc = [tableDataInstance tableEncoding];
+ NSString *tableColl = [tableStatus objectForKey:@"Collation"];
+ if([tableColl length]) {
+ // instead of @"latin1 (latin1_german_ci)" we can just show @"latin1 (german_ci)"
+ if([tableColl hasPrefix:[NSString stringWithFormat:@"%@_",tableEnc]]) tableColl = [tableColl substringFromIndex:([tableEnc length]+1)];
+ [info addObject:[NSString stringWithFormat:NSLocalizedString(@"encoding: %1$@ (%2$@)", @"Table Info Section : $1 = table charset, $2 = table collation"), tableEnc, tableColl]];
+ }
+ else {
+ [info addObject:[NSString stringWithFormat:NSLocalizedString(@"encoding: %1$@", @"Table Info Section : $1 = table charset"), tableEnc]];
+ }
if (![[tableStatus objectForKey:@"Auto_increment"] isNSNull]) {
[info addObject:[NSString stringWithFormat:NSLocalizedString(@"auto_increment: %@", @"Table Info Section : current value of auto_increment"),