Fix root refresh in filedrawer.

CQTexperiment
vspader 2007-07-06 00:26:45 +00:00
parent 0700ea5ead
commit bb489aeff9
2 changed files with 3 additions and 6 deletions

View File

@ -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!

View File

@ -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];
} }