- switch (group) {
- case 0: switch (row) {
- case 0:
- [cell setTitle:[package_ name]];
- [cell setValue:[package_ latest]];
- break;
-
- case 1:
- [cell addSubview:description_];
- break;
-
- case 2:
- [cell setTitle:@"More Information"];
- [cell setShowDisclosure:YES];
- [cell setShowSelection:YES];
- break;
-
- default: _assert(false);
- } break;
-
- case 1: switch (row) {
- case 0:
- [cell setTitle:@"Identifier"];
- [cell setValue:[package_ id]];
- break;
-
- case 1: {
- [cell setTitle:@"Installed Version"];
- NSString *installed([package_ installed]);
- [cell setValue:(installed == nil ? @"n/a" : installed)];
- } break;
-
- case 2: {
- [cell setTitle:@"Section"];
- NSString *section([package_ section]);
- [cell setValue:(section == nil ? @"n/a" : section)];
- } break;
-
- case 3:
- [cell setTitle:@"Expanded Size"];
- [cell setValue:SizeString([package_ size])];
- break;
-
- case 4:
- [cell setTitle:@"Maintainer"];
- [cell setValue:[[package_ maintainer] name]];
- [cell setShowDisclosure:YES];
- [cell setShowSelection:YES];
- break;
-
- default: _assert(false);
- } break;
-
- case 2: switch (row) {
- case 0:
- [cell setTitle:[[package_ source] label]];
- [cell setValue:[[package_ source] version]];
- break;
-
- case 1:
- [cell setValue:[[package_ source] description]];
- break;
-
- case 2:
- [cell setTitle:@"Origin"];
- [cell setValue:[[package_ source] origin]];
- break;
-
- default: _assert(false);
- } break;
-
- default: _assert(false);
- }
+ if (group-- == 0) {
+ if (false) {
+ } else if (row-- == 0) {
+ [cell setTitle:[package_ name]];
+ [cell setValue:[package_ latest]];
+ } else if ([package_ author] != nil && row-- == 0) {
+ [cell setTitle:@"Author"];
+ [cell setValue:[[package_ author] name]];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else if (description_ != nil && row-- == 0) {
+ [cell addSubview:description_];
+ } else if ([package_ website] != nil && row-- == 0) {
+ [cell setTitle:@"More Information"];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else _assert(false);
+ } else if ([package_ installed] != nil && group-- == 0) {
+ if (false) {
+ } else if (row-- == 0) {
+ [cell setTitle:@"Version"];
+ NSString *installed([package_ installed]);
+ [cell setValue:(installed == nil ? @"n/a" : installed)];
+ } else if (row-- == 0) {
+ [cell setTitle:@"Filesystem Content"];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else _assert(false);
+ } else if (group-- == 0) {
+ if (false) {
+ } else if (row-- == 0) {
+ [cell setTitle:@"Identifier"];
+ [cell setValue:[package_ id]];
+ } else if (row-- == 0) {
+ [cell setTitle:@"Section"];
+ NSString *section([package_ section]);
+ [cell setValue:(section == nil ? @"n/a" : section)];
+ } else if ([package_ size] != 0 && row-- == 0) {
+ [cell setTitle:@"Expanded Size"];
+ [cell setValue:SizeString([package_ size])];
+ } else if ([package_ maintainer] != nil && row-- == 0) {
+ [cell setTitle:@"Maintainer"];
+ [cell setValue:[[package_ maintainer] name]];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else if ([package_ sponsor] != nil && row-- == 0) {
+ [cell setTitle:@"Sponsor"];
+ [cell setValue:[[package_ sponsor] name]];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else if ([package_ relationships] != nil && row-- == 0) {
+ [cell setTitle:@"Package Relationships"];
+ [cell setShowDisclosure:YES];
+ [cell setShowSelection:YES];
+ } else if ([[package_ source] trusted] && row-- == 0) {
+ [cell setIcon:[UIImage applicationImageNamed:@"trusted.png"]];
+ [cell setValue:@"This package has been signed."];
+ } else _assert(false);
+ } else if ([package_ source] != nil && group-- == 0) {
+ Source *source = [package_ source];
+ NSString *description = [source description];
+
+ if (false) {
+ } else if (row-- == 0) {
+ NSString *label = [source label];
+ if (label == nil)
+ label = [source uri];
+ [cell setTitle:label];
+ [cell setValue:[source version]];
+ } else if (description != nil && ![description isEqualToString:[source label]] && row-- == 0) {
+ [cell setValue:description];
+ } else if ([source origin] != nil && row-- == 0) {
+ [cell setTitle:@"Origin"];
+ [cell setValue:[source origin]];
+ } else _assert(false);
+ } else _assert(false);