From bb489aeff98bb8dbca1c732f8061207499aa5077 Mon Sep 17 00:00:00 2001 From: vspader Date: Fri, 6 Jul 2007 00:26:45 +0000 Subject: [PATCH] Fix root refresh in filedrawer. --- FileDrawer/FileTreeController.m | 8 +++----- FileDrawer/FileTreeWatcher.m | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/FileDrawer/FileTreeController.m b/FileDrawer/FileTreeController.m index ce9c7ad5c..8f84a8306 100644 --- a/FileDrawer/FileTreeController.m +++ b/FileDrawer/FileTreeController.m @@ -21,6 +21,7 @@ [watcher setDelegate:self]; [self setRootPath: [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"] ]; + NSLog(@"AWAKENED"); } - (void)dealloc @@ -44,20 +45,17 @@ [rootPath release]; rootPath = r; - [watcher removePath:r]; - [watcher addPath:rootPath]; - [self refreshRoot]; } - (void) refreshRoot { DirectoryNode *base = [[DirectoryNode alloc] initWithPath:rootPath controller:self]; - NSLog(@"Subpaths: %i", [[base subpaths] count]); [self setContent: [base subpaths]]; - NSLog(@"Test: %i", [[self content] retainCount]); [base release]; + + [watcher addPath:rootPath]; } //BUG IN NSTREECONTROLLER'S SETCONTENT. FIX YOUR SHIT, APPLE! diff --git a/FileDrawer/FileTreeWatcher.m b/FileDrawer/FileTreeWatcher.m index bd009feca..df34d58dd 100644 --- a/FileDrawer/FileTreeWatcher.m +++ b/FileDrawer/FileTreeWatcher.m @@ -54,7 +54,6 @@ -(void) watcher: (id)kq receivedNotification: (NSString*)nm forPath: (NSString*)fpath { - NSLog(@"CHANGED! %@", fpath); [delegate refreshPath: fpath]; }