Search scopes no longer work but the program won't crash :)
parent
67816346e0
commit
b6a46c5ca1
|
@ -52,6 +52,7 @@ static NSPredicate * musicOnlyPredicate = nil;
|
||||||
NSValueTransformer *stringToSearchScopeTransformer = [[[StringToSearchScopeTransformer alloc]init]autorelease];
|
NSValueTransformer *stringToSearchScopeTransformer = [[[StringToSearchScopeTransformer alloc]init]autorelease];
|
||||||
[NSValueTransformer setValueTransformer:stringToSearchScopeTransformer forName:@"StringToSearchScopeTransformer"];
|
[NSValueTransformer setValueTransformer:stringToSearchScopeTransformer forName:@"StringToSearchScopeTransformer"];
|
||||||
|
|
||||||
|
[NSMetadataQuery exposeBinding:@"searchScopes"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)init
|
- (id)init
|
||||||
|
@ -71,17 +72,6 @@ static NSPredicate * musicOnlyPredicate = nil;
|
||||||
selector:@selector(compareTrackNumbers:)],
|
selector:@selector(compareTrackNumbers:)],
|
||||||
nil];
|
nil];
|
||||||
|
|
||||||
// We want to bind the query's search scope to the user default that is
|
|
||||||
// set from the NSPathControl.
|
|
||||||
NSDictionary *bindOptions =
|
|
||||||
[NSDictionary dictionaryWithObject:@"StringToSearchScopeTransformer"
|
|
||||||
forKey:NSValueTransformerNameBindingOption];
|
|
||||||
|
|
||||||
[self.query bind:@"searchScopes"
|
|
||||||
toObject:[NSUserDefaultsController sharedUserDefaultsController]
|
|
||||||
withKeyPath:@"values.spotlightSearchPath"
|
|
||||||
options:bindOptions];
|
|
||||||
|
|
||||||
// hook my query transformer up to me
|
// hook my query transformer up to me
|
||||||
[PausingQueryTransformer setSearchController:self];
|
[PausingQueryTransformer setSearchController:self];
|
||||||
}
|
}
|
||||||
|
@ -247,8 +237,6 @@ static NSPredicate * musicOnlyPredicate = nil;
|
||||||
self.searchString = [NSString stringWithFormat:@"%%l\"%@\"", album];
|
self.searchString = [NSString stringWithFormat:@"%%l\"%@\"", album];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
self.query = nil;
|
self.query = nil;
|
||||||
|
|
Loading…
Reference in New Issue