2006-09-02 12:09:20 -04:00
|
|
|
//
|
|
|
|
// DirectoryNode.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 8/20/2006.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "DirectoryNode.h"
|
2007-10-14 20:24:54 -03:00
|
|
|
|
2006-09-02 12:09:20 -04:00
|
|
|
#import "FileNode.h"
|
2006-09-26 18:22:56 -04:00
|
|
|
#import "SmartFolderNode.h"
|
2006-09-02 12:09:20 -04:00
|
|
|
|
2007-10-14 20:24:54 -03:00
|
|
|
#import "FileTreeController.h"
|
|
|
|
#import "FileTreeWatcher.h"
|
2006-09-17 14:11:29 -04:00
|
|
|
|
2007-10-14 20:24:54 -03:00
|
|
|
@implementation DirectoryNode
|
2006-09-02 12:09:20 -04:00
|
|
|
|
|
|
|
- (BOOL)isLeaf
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2006-09-26 18:22:56 -04:00
|
|
|
- (NSArray *)subpaths
|
|
|
|
{
|
|
|
|
if (subpaths == nil)
|
|
|
|
{
|
|
|
|
subpaths = [[NSMutableArray alloc] init];
|
2007-02-18 15:59:23 -03:00
|
|
|
NSArray *contents = [[[NSFileManager defaultManager] directoryContentsAtPath:path] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
|
2007-10-14 20:24:54 -03:00
|
|
|
NSLog(@"Contents: %@", contents);
|
|
|
|
[self processPaths: contents];
|
2006-09-26 18:22:56 -04:00
|
|
|
|
2007-10-14 20:24:54 -03:00
|
|
|
// [[controller watcher] addPath:[self path]];
|
2006-09-02 12:09:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return subpaths;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|