From 8a8dd9eca7baf99e154bcce3bd3e7adeecfb06e5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:41:01 +0000 Subject: [PATCH] Monotone-Parent: 4db4e94b1f353dbdc30ed2247f4848acd4afdb7e Monotone-Revision: 08eb86c1f84dbf4d09421e5a6380398cb40d40e0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:41:01 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/NSArray+Utilities.h | 6 ++++++ SoObjects/SOGo/NSArray+Utilities.m | 11 +++++++++++ 3 files changed, 20 insertions(+) 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 +