From ae469a43ec473bbcd0d31906caf91ea013d0c052 Mon Sep 17 00:00:00 2001 From: vspader Date: Thu, 13 Mar 2008 02:07:49 +0000 Subject: [PATCH] Fix for spotlight crash. --- English.lproj/MainMenu.xib | 42 ++++++++++++++++++--------- Spotlight/SpotlightWindowController.m | 25 ++++++++-------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 0afcc207c..de75dbf7f 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -8,12 +8,12 @@ 352.00 YES - - - - - + + + + + YES @@ -5575,7 +5575,7 @@ MDA4AA - + NSIsNil @@ -5611,7 +5611,7 @@ MDA4AA Not Playing - + 2 @@ -5646,7 +5646,7 @@ MDA4AA Not Playing - + 2 @@ -5682,7 +5682,7 @@ MDA4AA - + NSIsNotNil @@ -5719,7 +5719,7 @@ MDA4AA - + NSIsNotNil @@ -5756,7 +5756,7 @@ MDA4AA - + NSIsNotNil @@ -5828,7 +5828,7 @@ MDA4AA - + NSIsNotNil @@ -5837,6 +5837,22 @@ MDA4AA 2107 + + + searchByArtist: + + + + 2118 + + + + searchByAlbum: + + + + 2119 + @@ -8803,7 +8819,7 @@ MDA4AA - 2117 + 2119 diff --git a/Spotlight/SpotlightWindowController.m b/Spotlight/SpotlightWindowController.m index accf87d6d..c7d7638be 100644 --- a/Spotlight/SpotlightWindowController.m +++ b/Spotlight/SpotlightWindowController.m @@ -74,6 +74,19 @@ static NSPredicate * musicOnlyPredicate = nil; // hook my query transformer up to me [PausingQueryTransformer setSearchController:self]; + + [self registerDefaults]; + + // 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]; } return self; @@ -81,18 +94,6 @@ static NSPredicate * musicOnlyPredicate = nil; - (void)awakeFromNib { - [self registerDefaults]; - - // 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]; } - (IBAction)toggleWindow:(id)sender