Updates for smart folders.

CQTexperiment
vspader 2006-09-26 23:23:42 +00:00
parent e8242824a8
commit 38ecd2f47f
1 changed files with 8 additions and 3 deletions

View File

@ -100,7 +100,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryUpdate:) name:(NSString*)kMDQueryDidUpdateNotification object:(id)query];
NSLog(@"PATHS: %@", searchPaths);
MDQueryExecute(query, kMDQueryWantsUpdates | kMDQuerySynchronous);
MDQueryExecute(query, kMDQueryWantsUpdates);
NSLog(@"QUERY FINISHED: %@", subpaths);
}
@ -130,6 +130,7 @@
NSMutableArray *results = [NSMutableArray array];
MDQueryDisableUpdates(query);
int c = MDQueryGetResultCount(query);
int i;
@ -144,15 +145,19 @@
[itemPath release];
}
MDQueryEnableUpdates(query);
[self processContents:results];
NSLog(@"CONTENTS PROCESSED");
[self setSubpaths:subpaths];
}
- (void)queryUpdate:(NSNotification *)notification
{
MDQueryRef query = [notification object];
NSLog(@"QUERY UPDATE: %@", notification);
[subpaths removeAllObjects];
[self queryFinished: notification];
}