From f18bd36d312efef1da41abeb128ac38e7a79cf02 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 17 Jan 2007 23:36:17 +0000 Subject: [PATCH] for file selection checks, only reload those that are affected by any change --- macosx/InfoWindowController.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index b7a5a36f7..9a3c8ad2f 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -54,7 +54,7 @@ - (NSArray *) peerSortDescriptors; - (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item; -- (void) resetFileCheckStateForItem: (NSMutableDictionary *) item; +- (NSMutableDictionary *) resetFileCheckStateForItemParent: (NSMutableDictionary *) originalChild; @end @@ -691,9 +691,9 @@ int state = [object intValue] != NSOffState; [self setFileCheckState: state forItem: item]; - [self resetFileCheckStateForItem: [item objectForKey: @"Parent"]]; + NSMutableDictionary * topItem = [self resetFileCheckStateForItemParent: item]; - [fFileOutline reloadData]; + [fFileOutline reloadItem: topItem reloadChildren: YES]; } - (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item @@ -712,10 +712,11 @@ } } -- (void) resetFileCheckStateForItem: (NSMutableDictionary *) item +- (NSMutableDictionary *) resetFileCheckStateForItemParent: (NSMutableDictionary *) originalChild { - if (!item) - return; + NSMutableDictionary * item; + if (!(item = [originalChild objectForKey: @"Parent"])) + return originalChild; int state = INVALID; @@ -740,8 +741,10 @@ if ([[item objectForKey: @"Check"] intValue] != state) { [item setObject: [NSNumber numberWithInt: state] forKey: @"Check"]; - [self resetFileCheckStateForItem: [item objectForKey: @"Parent"]]; + return [self resetFileCheckStateForItemParent: item]; } + else + return originalChild; } - (void) outlineView: (NSOutlineView *) outlineView willDisplayCell: (id) cell