summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-11 11:18:27 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-11 11:18:27 -0800
commit90ba4f86f48b9f702e6d62d91c4751cd99e090fd (patch)
tree8db0067f7555a820c2d47c49c2ab6442b44947a4
parent139021775a4a105f85659c8ae4494ef7a33ddb1d (diff)
Remove confusing SourceController sections.v1.1.0%b6
-rw-r--r--MobileCydia.mm38
1 files changed, 7 insertions, 31 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index c7c7061..18015b9 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1351,7 +1351,7 @@ static void PackageImport(const void *key, const void *value, void *context) {
- (Source *) initWithMetaIndex:(metaIndex *)index forDatabase:(Database *)database inPool:(apr_pool_t *)pool;
-- (NSComparisonResult) compareByNameAndType:(Source *)source;
+- (NSComparisonResult) compareByName:(Source *)source;
- (NSString *) depictionForPackage:(NSString *)package;
- (NSString *) supportForPackage:(NSString *)package;
@@ -1540,13 +1540,7 @@ static void PackageImport(const void *key, const void *value, void *context) {
return [NSString stringWithString:[(NSString *) CYStringCreate(start, end - start) autorelease]];
} }
-- (NSComparisonResult) compareByNameAndType:(Source *)source {
- NSDictionary *lhr = [self record];
- NSDictionary *rhr = [source record];
-
- if ((lhr == nil) != (rhr == nil))
- return lhr == nil ? NSOrderedDescending : NSOrderedAscending;
-
+- (NSComparisonResult) compareByName:(Source *)source {
NSString *lhs = [self name];
NSString *rhs = [source name];
@@ -8206,37 +8200,19 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
}
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
- return offset_ == 0 ? 1 : 2;
+ return 1;
}
- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
- switch (section + (offset_ == 0 ? 1 : 0)) {
- case 0: return UCLocalize("ENTERED_BY_USER");
- case 1: return UCLocalize("INSTALLED_BY_PACKAGE");
-
- _nodefault
- }
+ return nil;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- int count = [sources_ count];
- switch (section) {
- case 0: return (offset_ == 0 ? count : offset_);
- case 1: return count - offset_;
-
- _nodefault
- }
+ return [sources_ count];
}
- (Source *) sourceAtIndexPath:(NSIndexPath *)indexPath {
- unsigned idx = 0;
- switch (indexPath.section) {
- case 0: idx = indexPath.row; break;
- case 1: idx = indexPath.row + offset_; break;
-
- _nodefault
- }
- return [sources_ objectAtIndex:idx];
+ return [sources_ objectAtIndex:[indexPath row]];
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -8512,7 +8488,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
sources_ = [NSMutableArray arrayWithCapacity:16];
[sources_ addObjectsFromArray:[database_ sources]];
_trace();
- [sources_ sortUsingSelector:@selector(compareByNameAndType:)];
+ [sources_ sortUsingSelector:@selector(compareByName:)];
_trace();
int count([sources_ count]);