Fix root refresh in filedrawer.
parent
0700ea5ead
commit
bb489aeff9
|
@ -21,6 +21,7 @@
|
||||||
[watcher setDelegate:self];
|
[watcher setDelegate:self];
|
||||||
|
|
||||||
[self setRootPath: [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"] ];
|
[self setRootPath: [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"] ];
|
||||||
|
NSLog(@"AWAKENED");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
|
@ -44,20 +45,17 @@
|
||||||
[rootPath release];
|
[rootPath release];
|
||||||
rootPath = r;
|
rootPath = r;
|
||||||
|
|
||||||
[watcher removePath:r];
|
|
||||||
[watcher addPath:rootPath];
|
|
||||||
|
|
||||||
[self refreshRoot];
|
[self refreshRoot];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) refreshRoot
|
- (void) refreshRoot
|
||||||
{
|
{
|
||||||
DirectoryNode *base = [[DirectoryNode alloc] initWithPath:rootPath controller:self];
|
DirectoryNode *base = [[DirectoryNode alloc] initWithPath:rootPath controller:self];
|
||||||
NSLog(@"Subpaths: %i", [[base subpaths] count]);
|
|
||||||
[self setContent: [base subpaths]];
|
[self setContent: [base subpaths]];
|
||||||
NSLog(@"Test: %i", [[self content] retainCount]);
|
|
||||||
|
|
||||||
[base release];
|
[base release];
|
||||||
|
|
||||||
|
[watcher addPath:rootPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
//BUG IN NSTREECONTROLLER'S SETCONTENT. FIX YOUR SHIT, APPLE!
|
//BUG IN NSTREECONTROLLER'S SETCONTENT. FIX YOUR SHIT, APPLE!
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
|
|
||||||
-(void) watcher: (id<UKFileWatcher>)kq receivedNotification: (NSString*)nm forPath: (NSString*)fpath
|
-(void) watcher: (id<UKFileWatcher>)kq receivedNotification: (NSString*)nm forPath: (NSString*)fpath
|
||||||
{
|
{
|
||||||
NSLog(@"CHANGED! %@", fpath);
|
|
||||||
[delegate refreshPath: fpath];
|
[delegate refreshPath: fpath];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue