Skip to content

Commit

Permalink
Extract -indexResultAtPath: method.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhl committed Sep 24, 2009
1 parent 8c0dad6 commit 83cd394
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions DockItemsSource.m
Expand Up @@ -48,19 +48,20 @@ - (void)recacheContentsAfterDelay:(NSTimeInterval)delay
afterDelay:delay];
}

- (void)indexItemAtPath:(NSString *)path
- (void)indexResultAtPath:(NSString *)path
{
[self indexResult:[HGSResult resultWithFilePath:path
source:self
attributes:nil]];
}

- (void)indexItemAtPath:(NSString *)path
{
[self indexResultAtPath:path];
NSFileManager *manager = [NSFileManager defaultManager];
for (NSString *subpath in [manager directoryContentsAtPath:path]) {
if ([subpath hasPrefix:@"."]) continue;
subpath = [path stringByAppendingPathComponent:subpath];
[self indexResult:[HGSResult resultWithFilePath:subpath
source:self
attributes:nil]];
}
for (NSString *subpath in [manager directoryContentsAtPath:path])
if (![subpath hasPrefix:@"."])
[self indexResultAtPath:[path stringByAppendingPathComponent:subpath]];
}

@end

0 comments on commit 83cd394

Please sign in to comment.