Updates for smart folders.

This commit is contained in:
vspader 2006-09-26 23:23:42 +00:00
parent e8242824a8
commit 38ecd2f47f

View file

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