- ++upgrades_;
- [upgradable addToCount];
- }
- }
- _trace();
-
- CFRelease(formatter);
-
- if (unseens) {
- Section *last = [sections_ lastObject];
- size_t count = [last count];
- CFArrayReplaceValues(packages_, CFRangeMake(CFArrayGetCount(packages_) - count, count), NULL, 0);
- [sections_ removeLastObject];
- }
-
- if ([ignored count] != 0)
- [sections_ insertObject:ignored atIndex:0];
- if (upgrades_ != 0)
- [sections_ insertObject:upgradable atIndex:0];
-
- [list_ reloadData];
-
- if (upgrades_ > 0)
- [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc]
- initWithTitle:[NSString stringWithFormat:UCLocalize("PARENTHETICAL"), UCLocalize("UPGRADE"), [NSString stringWithFormat:@"%u", upgrades_]]
- style:UIBarButtonItemStylePlain
- target:self
- action:@selector(upgradeButtonClicked)
- ] autorelease]];
-
- if (![delegate_ updating])
- [[self navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc]
- initWithTitle:UCLocalize("REFRESH")
- style:UIBarButtonItemStylePlain
- target:self
- action:@selector(refreshButtonClicked)
- ] autorelease]];
-
- PrintTimes();
-} }
-
-@end
-/* }}} */
-/* Search Controller {{{ */
-@interface SearchController : FilteredPackageController <
- UISearchBarDelegate
-> {
- UISearchBar *search_;
-}
-
-- (id) initWithDatabase:(Database *)database;
-- (void) reloadData;
-
-@end
-
-@implementation SearchController
-
-- (void) dealloc {
- [search_ release];
- [super dealloc];
-}
-
-- (void) searchBarSearchButtonClicked:(UISearchBar *)searchBar {
- [packages_ setObject:[search_ text] forFilter:@selector(isUnfilteredAndSearchedForBy:)];
- [search_ resignFirstResponder];
- [self reloadData];
-}
-
-- (void) searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)text {
- [packages_ setObject:text forFilter:@selector(isUnfilteredAndSelectedForBy:)];
- [self reloadData];
-}