Updates for smart folders.
This commit is contained in:
parent
e8242824a8
commit
38ecd2f47f
1 changed files with 8 additions and 3 deletions
|
@ -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;
|
||||||
|
@ -144,15 +145,19 @@
|
||||||
|
|
||||||
[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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue