Skip to content

Commit

Permalink
Fixed two search bugs. Selecting an item from the drop down list woul…
Browse files Browse the repository at this point in the history
…d not fire off a search, and got rid of logic that removed characters from search string typed into search box
  • Loading branch information
cmarrin committed Oct 18, 2012
1 parent eedbfba commit 824ccfc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
42 changes: 27 additions & 15 deletions English.lproj/MainMenu.nib/designable.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown.
15 changes: 12 additions & 3 deletions classes/FileInfoPanelController.m
Expand Up @@ -162,18 +162,27 @@ -(IBAction)artworkCheckedStateChanged:(id)sender
[m_fileListController rearrangeObjects];
}

-(IBAction)searchBoxSelected:(id)sender
- (void)searchStringSelected:(NSString*)searchString
{
NSString* searchString = [[sender stringValue] retain];

if ([searchString length]) {
m_metadataSearchCount = 0;
m_metadataSearchSucceeded = YES;
[m_fileListController searchSelectedFilesForString:searchString];
}
}

-(IBAction)searchBoxSelected:(id)sender
{
NSString* searchString = [[sender stringValue] retain];
[self searchStringSelected:searchString];
[searchString release];
}

- (void)comboBoxSelectionDidChange:(NSNotification *)notification
{
[self searchStringSelected:[notification.object objectValueOfSelectedItem]];
}

- (IBAction)useSeasonValueForAllFiles:(id)sender
{
if ([m_fileListController selection]) {
Expand Down
6 changes: 4 additions & 2 deletions classes/MetadataSearch.m
Expand Up @@ -289,6 +289,7 @@ -(void) searchWithString:(NSString*) string filename:(NSString*) filename
[self checkString:filename forSeason:&m_season episode:&m_episode];
}

/*
// Get the season and episode out of the string and use it if needed
int season;
int episode;
Expand All @@ -299,7 +300,8 @@ -(void) searchWithString:(NSString*) string filename:(NSString*) filename
if (m_episode < 0 && episode >= 0)
m_episode = episode;

*/

// see if the search string in in our list already
int i = 0;
for (NSString* name in self.foundShowNames) {
Expand All @@ -318,7 +320,7 @@ -(void) searchWithString:(NSString*) string filename:(NSString*) filename
self.foundShowIds = nil;
self.foundSearcher = nil;

[self _searchForShows: newString withSelector:@selector(searchWithStringComplete:)];
[self _searchForShows: string withSelector:@selector(searchWithStringComplete:)];
}

-(void) searchWithFilenameCallback:(NSNumber*) success
Expand Down

0 comments on commit 824ccfc

Please sign in to comment.