diff --git a/ChangeLog b/ChangeLog index d3bcf0a23..24da98a58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-08-21 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoObject.m ([SOGoObject + +objectWithName:inContainer:]): new constructor. + + * SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder + -lookupContactWithId:recordId]): always create a contact object, + even if it does not exist. + 2006-08-18 Wolfgang Sourdeau * UI/Scheduler/UIxCalMainView.[hm]: new class to serve as a pseudo diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 477b6fb60..9a5cd4abd 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -77,20 +77,10 @@ - (id ) lookupContactWithId: (NSString *) recordId { SOGoContactGCSEntry *contact; - NSArray *contactIds; if ([recordId length] > 0) - { - contactIds = [self fetchContentObjectNames]; - if ([contactIds containsObject: recordId]) - { - contact = [[SOGoContactGCSEntry alloc] initWithName: recordId - inContainer: self]; - [contact autorelease]; - } - else - contact = nil; - } + contact = [SOGoContactGCSEntry objectWithName: recordId + inContainer: self]; else contact = nil; diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index f04ad5732..bbf922220 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -44,6 +44,8 @@ id container; } ++ (id) objectWithName: (NSString *)_name inContainer:(id)_container; + - (id)initWithName:(NSString *)_name inContainer:(id)_container; /* accessors */ diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 1c611d7cf..835c37930 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -60,6 +60,16 @@ static BOOL kontactGroupDAV = YES; /* containment */ ++ (id) objectWithName: (NSString *)_name inContainer:(id)_container +{ + SOGoObject *object; + + object = [[self alloc] initWithName: _name inContainer: _container]; + [object autorelease]; + + return object; +} + - (BOOL)doesRetainContainer { return YES; } @@ -72,6 +82,7 @@ static BOOL kontactGroupDAV = YES; } return self; } + - (id)init { return [self initWithName:nil inContainer:nil]; }