aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-03-21 01:31:09 +0000
committerrowanbeentje <rowan@beent.je>2012-03-21 01:31:09 +0000
commit3916b4227d1e02942504e13a2d36b3e6f57670bb (patch)
tree392fc9f3ed09c8cbe5719d04e45303ae2ff190b7 /Source/SPTableStructure.m
parent566aa46a231fd45a4c373a8122ab2bb6aa39ced6 (diff)
downloadsequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.tar.gz
sequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.tar.bz2
sequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.zip
- Fix a possible race condition exception when switching between tables when th structure view was active, the collation column was visible, and fields had custom collations
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index 085cc558..c6f20ded 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -292,15 +292,19 @@
// Set up the encoding PopUpButtonCell
NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings];
if ([encodings count]) {
- [[encodingPopupCell onMainThread] removeAllItems];
- [[encodingPopupCell onMainThread] addItemWithTitle:@""];
// Populate encoding popup button
+ NSMutableArray *encodingTitles = [[NSMutableArray alloc] initWithCapacity:[encodings count]+1];
+ [encodingTitles addObject:@""];
for (NSDictionary *encoding in encodings)
- [[encodingPopupCell onMainThread] addItemWithTitle:(![encoding objectForKey:@"DESCRIPTION"]) ? [encoding objectForKey:@"CHARACTER_SET_NAME"] : [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]];
+ [encodingTitles addObject:(![encoding objectForKey:@"DESCRIPTION"]) ? [encoding objectForKey:@"CHARACTER_SET_NAME"] : [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]];
+ [[encodingPopupCell onMainThread] removeAllItems];
+ [[encodingPopupCell onMainThread] addItemsWithTitles:encodingTitles];
+ [encodingTitles release];
}
else {
+ [[encodingPopupCell onMainThread] removeAllItems];
[[encodingPopupCell onMainThread] addItemWithTitle:NSLocalizedString(@"Not available", @"not available label")];
}