diff --git a/Spotlight/SpotlightWindowController.m b/Spotlight/SpotlightWindowController.m index 9fc76c138..3ec659006 100644 --- a/Spotlight/SpotlightWindowController.m +++ b/Spotlight/SpotlightWindowController.m @@ -79,6 +79,20 @@ static NSPredicate * musicOnlyPredicate = nil; return self; } +- (void)awakeFromNib +{ + // 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]; +} + - (void)performSearch { NSPredicate *searchPredicate;