summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin L. Howett <dustin@howett.net>2010-11-22 20:27:05 -0500
committerDustin L. Howett <dustin@howett.net>2010-11-22 20:27:05 -0500
commit1b18f0262a9662e5d666523ca70bd8df220e28b6 (patch)
tree2fa7f49faec6e37526aeac841da081fca999b773
parent7e37a67619923da62b21ca0d4527ccd5ec0bf1b7 (diff)
Add and fix the display of ignored (SelectedState == Hold) packages and abolish the use/storage of IsIgnored in the metadata - rely on apt to track that for us. We currently cannot (do not) set a held state, as apt doesn't expose a means by which to do this, or I have not yet found such a means.
-rw-r--r--MobileCydia.mm20
1 files changed, 11 insertions, 9 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 950012c..c4abc53 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1735,6 +1735,7 @@ typedef std::map< unsigned long, _H<Source> > SourceMap;
_transient NSDate *firstSeen_;
_transient NSDate *lastSeen_;
bool subscribed_;
+ bool ignored_;
}
- (Package *) initWithVersion:(pkgCache::VerIterator)version withZone:(NSZone *)zone inPool:(apr_pool_t *)pool database:(Database *)database;
@@ -2180,6 +2181,8 @@ struct PackageNameOrdering :
obsolete_ = [self hasTag:@"cydia::obsolete"];
essential_ = ((iterator_->Flags & pkgCache::Flag::Essential) == 0 ? NO : YES) || [self hasTag:@"cydia::essential"];
_end
+
+ ignored_ = iterator_->SelectedState == pkgCache::State::Hold;
_end } return self;
}
@@ -2311,11 +2314,7 @@ struct PackageNameOrdering :
}
- (BOOL) ignored {
- NSDictionary *metadata([self metadata]);
- if (NSNumber *ignored = [metadata objectForKey:@"IsIgnored"])
- return [ignored boolValue];
- else
- return false;
+ return ignored_;
}
- (NSString *) latest {
@@ -7040,7 +7039,7 @@ freeing the view controllers on tab change */
#endif
Section *upgradable = [[[Section alloc] initWithName:UCLocalize("AVAILABLE_UPGRADES") localize:NO] autorelease];
- Section *ignored = [[[Section alloc] initWithName:UCLocalize("IGNORED_UPGRADES") localize:NO] autorelease];
+ Section *ignored = nil;
Section *section = nil;
NSDate *last = nil;
@@ -7081,9 +7080,12 @@ freeing the view controllers on tab change */
}
[section addToCount];
- } else if ([package ignored])
+ } else if ([package ignored]) {
+ if (ignored == nil) {
+ ignored = [[[Section alloc] initWithName:UCLocalize("IGNORED_UPGRADES") row:offset localize:NO] autorelease];
+ }
[ignored addToCount];
- else {
+ } else {
++upgrades_;
[upgradable addToCount];
}
@@ -7269,7 +7271,7 @@ freeing the view controllers on tab change */
}
- (void) onIgnored:(id)control {
- [self onSomething:(int) [control isOn] withKey:@"IsIgnored"];
+ // TODO: set Held state - possibly call out to dpkg, etc.
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {