A little bit of cleanup.
parent
9414c97c09
commit
8bf061bb14
|
@ -59,29 +59,32 @@
|
||||||
|
|
||||||
- (PathNode *)nodeForPath:(NSString *)path
|
- (PathNode *)nodeForPath:(NSString *)path
|
||||||
{
|
{
|
||||||
NSString *relativePath = [path stringByReplacingOccurrencesOfString:[[[self rootURL] path] stringByAppendingString:@"/"] withString:@"" options:NSAnchoredSearch range:NSMakeRange(0, [path length])];
|
NSString *relativePath = [[path stringByReplacingOccurrencesOfString:[[[self rootURL] path] stringByAppendingString:@"/"]
|
||||||
relativePath = [relativePath stringByStandardizingPath];
|
withString:@""
|
||||||
PathNode *theNode = rootNode;
|
options:NSAnchoredSearch
|
||||||
|
range:NSMakeRange(0, [path length])
|
||||||
|
] stringByStandardizingPath];
|
||||||
|
PathNode *node = rootNode;
|
||||||
NSLog(@"Root | Relative | Path: %@ | %@ | %@",[[self rootURL] path], relativePath, path);
|
NSLog(@"Root | Relative | Path: %@ | %@ | %@",[[self rootURL] path], relativePath, path);
|
||||||
for(NSString *c in [relativePath pathComponents])
|
for(NSString *c in [relativePath pathComponents])
|
||||||
{
|
{
|
||||||
NSLog(@"COMPONENT: %@", c);
|
NSLog(@"COMPONENT: %@", c);
|
||||||
BOOL found = NO;
|
BOOL found = NO;
|
||||||
for (PathNode *node in [theNode subpaths]) {
|
for (PathNode *subnode in [node subpaths]) {
|
||||||
if ([[[[node url] path] lastPathComponent] isEqualToString:c]) {
|
if ([[[[subnode url] path] lastPathComponent] isEqualToString:c]) {
|
||||||
theNode = node;
|
node = subnode;
|
||||||
found = YES;
|
found = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
|
NSLog(@"Not found!");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
NSLog(@"Component: %@", c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return theNode;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)pathDidChange:(NSString *)path
|
- (void)pathDidChange:(NSString *)path
|
||||||
|
|
Loading…
Reference in New Issue