From b1a76aa21a5408778de795d9932499195e09cbda Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 21 Aug 2006 17:43:36 +0000 Subject: [PATCH] Monotone-Parent: 2e091eebec7082ccae481171b67c0091e367dcb1 Monotone-Revision: 188f677989080c34ae076500016b9830247f2cbe Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-21T17:43:36 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++++++++ SoObjects/Contacts/SOGoContactGCSFolder.m | 14 ++------------ SoObjects/SOGo/SOGoObject.h | 2 ++ SoObjects/SOGo/SOGoObject.m | 11 +++++++++++ 4 files changed, 24 insertions(+), 12 deletions(-) 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]; }