From b86ba6df28e4cde39bc1ba872d713c1fbbb87596 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Wed, 9 May 2012 15:48:15 +0000 Subject: More gcc warning fixes. --- Source/SPBundleEditorController.m | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index b807a52d..4be98c40 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -1222,31 +1222,30 @@ - (BOOL)outlineView:(id)outlineView isItemExpandable:(id)item { - if([item isKindOfClass:[NSDictionary class]] && [item objectForKey:kChildrenKey]) - return YES; - return NO; + return [item isKindOfClass:[NSDictionary class]] && [item objectForKey:kChildrenKey]; } - (NSInteger)outlineView:(id)outlineView numberOfChildrenOfItem:(id)item { - if(item == nil) item = commandBundleTree; + if (item == nil) item = commandBundleTree; - if([item isKindOfClass:[NSDictionary class]]) - if([item objectForKey:kChildrenKey]) - return [[item objectForKey:kChildrenKey] count]; - else - return [item count]; + if ([item isKindOfClass:[NSDictionary class]]) { + return [item objectForKey:kChildrenKey] ? [[item objectForKey:kChildrenKey] count] : [item count]; + } - if([item isKindOfClass:[NSArray class]]) + if ([item isKindOfClass:[NSArray class]]) { return [item count]; + } return 0; } - (id)outlineView:(id)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { - if(item && [[item representedObject] respondsToSelector:@selector(objectForKey:)]) + if (item && [[item representedObject] respondsToSelector:@selector(objectForKey:)]) { return [[item representedObject] objectForKey:kBundleNameKey]; + } + return @""; } @@ -2129,4 +2128,3 @@ } @end - -- cgit v1.2.3