Skip to content

Commit

Permalink
Fix logic error when importing using setup assistant, resulting in so…
Browse files Browse the repository at this point in the history
…me unwanted files coming through.
  • Loading branch information
vade committed Jun 2, 2012
1 parent 10f683f commit 0827b8a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions OpenEmu/OELibraryController.m
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,6 @@ - (void)discoverRoms:(NSArray*)volumes

- (void)updateSearchResults:(NSNotification *)notification
{
DLog(@"updateSearchResults:");

MDQueryRef searchQuery = (__bridge MDQueryRef)[notification object];


Expand All @@ -454,6 +452,7 @@ - (void)updateSearchResults:(NSNotification *)notification
@"Developer",
@"Volumes",
@"Applications",
@"Application Support",
@"bin",
@"cores",
@"dev",
Expand All @@ -469,7 +468,6 @@ - (void)updateSearchResults:(NSNotification *)notification
@"readme", // markdown
@"README", // markdown
@"Readme", // markdown

nil];

// assume the latest result is the last index?
Expand All @@ -479,7 +477,13 @@ - (void)updateSearchResults:(NSNotification *)notification
NSString *resultPath = (__bridge_transfer NSString *)MDItemCopyAttribute(resultItem, kMDItemPath);

// Nothing in common
if([[resultPath pathComponents] firstObjectCommonWithArray:excludedPaths] == nil)
NSString* fileName = [[resultPath lastPathComponent] stringByDeletingPathExtension];
BOOL containExcludedFileName = [excludedPaths containsObject:fileName];

NSString* firstCommonObj = [excludedPaths firstObjectCommonWithArray:[resultPath pathComponents]];
BOOL containExcludedPathComponents = (firstCommonObj != nil);

if(!containExcludedPathComponents && !containExcludedFileName)
{
NSDictionary *resultDict = [[NSDictionary alloc] initWithObjectsAndKeys:
resultPath, @"Path",
Expand Down

0 comments on commit 0827b8a

Please sign in to comment.