diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-24 19:38:12 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:17 -0800 |
commit | de1ace71a801664ca0ed2812935fa63997eea18b (patch) | |
tree | 7796eb876b43cc240fff0f1b97c634e60f3b26ec /MobileCydia.mm | |
parent | 5959b5962b87ae2d5bfa54d0932b54f42b5e24d5 (diff) |
Add package.selection.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 249f6f0..5ff7013 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2360,6 +2360,7 @@ struct PackageNameOrdering : @"purposes", @"relations", @"section", + @"selection", @"shortDescription", @"shortSection", @"simpleSection", @@ -2944,6 +2945,27 @@ struct PackageNameOrdering : return (NSString *) [NSNull null]; } } +- (NSString *) selection { +@synchronized (database_) { + if ([database_ era] != era_ || file_.end()) + return nil; + + switch (iterator_->SelectedState) { + case pkgCache::State::Unknown: + return @"Unknown"; + case pkgCache::State::Install: + return @"Install"; + case pkgCache::State::Hold: + return @"Hold"; + case pkgCache::State::DeInstall: + return @"DeInstall"; + case pkgCache::State::Purge: + return @"Purge"; + } + + return (NSString *) [NSNull null]; +} } + - (NSArray *) warnings { NSMutableArray *warnings([NSMutableArray arrayWithCapacity:4]); const char *name(iterator_.Name()); |