diff --git a/ChangeLog b/ChangeLog index 5943bf0b0..00cca87c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/NSArray+Utilities.m ([NSMutableArray + -addObjectUniquely:object]): new method with an explicit name. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -aclUsers]): renamed "acl" to "aclUsers". Now designed to return only the uid of the users involved in an ACL. diff --git a/SoObjects/SOGo/NSArray+Utilities.h b/SoObjects/SOGo/NSArray+Utilities.h index 15cbb174b..2617538d3 100644 --- a/SoObjects/SOGo/NSArray+Utilities.h +++ b/SoObjects/SOGo/NSArray+Utilities.h @@ -39,4 +39,10 @@ @end +@interface NSMutableArray (SOGoArrayUtilities) + +- (void) addObjectUniquely: (id) object; + +@end + #endif /* NSARRAY_UTILITIES_H */ diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index ed30b5e5a..75dec348c 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -59,3 +59,14 @@ } @end + +@implementation NSMutableArray (SOGoArrayUtilities) + +- (void) addObjectUniquely: (id) object +{ + if (![self containsObject: object]) + [self addObject: object]; +} + +@end +