BOOL searchloaded_;
}
-- (id) initWithDatabase:(Database *)database;
-- (void) setSearchTerm:(NSString *)term;
+- (id) initWithDatabase:(Database *)database query:(NSString *)query;
- (void) reloadData;
@end
return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://search/%@", [search_ text]]];
}
-- (void) setSearchTerm:(NSString *)searchTerm {
- [search_ setText:searchTerm];
- [self setObject:searchTerm];
- [self reloadData];
-}
-
- (void) searchBarSearchButtonClicked:(UISearchBar *)searchBar {
[self setObject:[search_ text] forFilter:@selector(isUnfilteredAndSearchedForBy:)];
[search_ resignFirstResponder];
[self reloadData];
}
-- (id) initWithDatabase:(Database *)database {
- if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:nil])) {
+- (id) initWithDatabase:(Database *)database query:(NSString *)query {
+ if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:query])) {
search_ = [[[UISearchBar alloc] init] autorelease];
[search_ setDelegate:self];
+
+ if (query != nil)
+ [search_ setText:query];
} return self;
}
}
if ([base isEqualToString:@"search"]) {
- controller = [[[SearchController alloc] initWithDatabase:database_] autorelease];
+ controller = [[[SearchController alloc] initWithDatabase:database_ query:nil] autorelease];
}
if ([base isEqualToString:@"changes"]) {
}
if (!external && [base isEqualToString:@"search"]) {
- controller = [[[SearchController alloc] initWithDatabase:database_] autorelease];
- [(SearchController *)controller setSearchTerm:argument];
+ controller = [[[SearchController alloc] initWithDatabase:database_ query:argument] autorelease];
}
if (!external && [base isEqualToString:@"sections"]) {