From 94f23c4fdbec00e9a6ea7f6a137994dfb1abd898 Mon Sep 17 00:00:00 2001 From: matthewleon Date: Mon, 18 Feb 2008 20:46:53 +0000 Subject: [PATCH] Spotlight: Search scopes work and crash solved. We now return to regular programming. --- Spotlight/SpotlightWindowController.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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;