/* }}} */
/* Section Cell {{{ */
@interface SectionCell : UISimpleTableCell {
+ NSString *basic_;
NSString *section_;
NSString *name_;
NSString *count_;
@implementation SectionCell
- (void) clearSection {
+ if (basic_ != nil) {
+ [basic_ release]
+ basic_ = nil;
+ }
+
if (section_ != nil) {
[section_ release];
section_ = nil;
}
- (void) onSwitch:(id)sender {
- NSMutableDictionary *metadata = [Sections_ objectForKey:section_];
+ NSMutableDictionary *metadata = [Sections_ objectForKey:basic_];
if (metadata == nil) {
metadata = [NSMutableDictionary dictionaryWithCapacity:2];
- [Sections_ setObject:metadata forKey:section_];
+ [Sections_ setObject:metadata forKey:basic_];
}
Changed_ = true;
name_ = [UCLocalize("ALL_PACKAGES") retain];
count_ = nil;
} else {
+ basic_ = [section name_];
+ if (basic_ != nil)
+ basic_ = [basic_ retain];
+
section_ = [section localized];
if (section_ != nil)
section_ = [section_ retain];
+
name_ = [(section_ == nil || [section_ length] == 0 ? UCLocalize("NO_SECTION") : section_) retain];
count_ = [[NSString stringWithFormat:@"%d", [section count]] retain];
if (editing_)
- [switch_ setValue:(isSectionVisible(section_) ? 1 : 0) animated:NO];
+ [switch_ setValue:(isSectionVisible(basic_) ? 1 : 0) animated:NO];
}
}