Skip to content

Instantly share code, notes, and snippets.

@pkieltyka
Created April 8, 2009 22:33
Show Gist options
  • Save pkieltyka/92094 to your computer and use it in GitHub Desktop.
Save pkieltyka/92094 to your computer and use it in GitHub Desktop.
-(void) controlTextDidChange:(NSNotification *)aNotification
{
if ([[queryField stringValue] length] == 0) {
[self.resultController hide];
[query clearQuery];
[progress stopAnimation:nil];
}else {
[progress startAnimation:nil];
[query executeQuery:[queryField stringValue]];
}
}
-(void) beginInitialGatheringHandler:(id)sender
{
NSLog(@"beginInitialGatheringHandler");
NSLog(@"query result count = %@", [NSNumber numberWithInt:[query resultCount]]);
}
-(void) processInitialGatheringHandler:(id)sender
{
NSLog(@"processInitialGatheringHandler");
NSLog(@"query result count = %@", [NSNumber numberWithInt:[query resultCount]]);
[self.resultController show];
}
-(void) finishInitialGatheringHandler:(id)sender
{
// TODO: if the only thing we do here is stop the query, perhaps
// I should move this to HMetadataQuery
NSLog(@"finishInitialGatheringHandler");
NSLog(@"query result count = %@", [NSNumber numberWithInt:[query resultCount]]);
if ([query resultCount] == 0) {
[self.resultController hide];
}
[progress stopAnimation:nil];
// Stop live queries in the background
[query stopQuery];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment