From 4f94e0a0a120fba845b040a6247a3af93f753c20 Mon Sep 17 00:00:00 2001 From: avenjamin Date: Mon, 24 Aug 2009 13:17:09 +0000 Subject: - Small code clean up. Simplified some logic. --- Source/SPUserManager.m | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'Source') diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 8b26b001..dbac9ea2 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -294,6 +294,7 @@ #pragma mark - #pragma mark OutlineView Delegate Methods + - (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { if ([cell isKindOfClass:[ImageAndTextCell class]]) @@ -330,12 +331,7 @@ - (BOOL)outlineView:(NSOutlineView *)olv shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item { - if ([[[item representedObject] children] count] == 0) - { - return TRUE; - } - return FALSE; - + return ([[[item representedObject] children] count] == 0); } - (void)outlineViewSelectionDidChange:(NSNotification *)notification @@ -652,25 +648,10 @@ return FALSE; id selectedObject = [[treeController selectedObjects] objectAtIndex:0]; - if ([[tabViewItem identifier] isEqualToString:@"General"]) - { - if ([selectedObject parent] == nil) { - return TRUE; - } else { - return FALSE; - } - } - else if ([[tabViewItem identifier] isEqualToString:@"Global Privileges"] || - [[tabViewItem identifier] isEqualToString:@"Resources"]) - { - if ([selectedObject parent] != nil) - { - return TRUE; - } - else - { - return FALSE; - } + if ([[tabViewItem identifier] isEqualToString:@"General"]) { + return ([selectedObject parent] == nil); + } else if ([[tabViewItem identifier] isEqualToString:@"Global Privileges"] || [[tabViewItem identifier] isEqualToString:@"Resources"]) { + return ([selectedObject parent] != nil); } return TRUE; -- cgit v1.2.3