diff --git a/ChangeLog b/ChangeLog index da7ac9b03..fcfa2ba7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-12-19 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -setOwner:newOwner]): + new method that sets a customOwner, which can be returned with + ownerInContext it set. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatecomponent:_component]): no longer set the owner of elements here. diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index def600ef9..63ab10ccd 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -47,6 +47,7 @@ NSString *nameInContainer; id container; NSTimeZone *userTimeZone; + NSString *customOwner; } + (id) objectWithName: (NSString *)_name inContainer:(id)_container; diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 3691f9627..ca66dff60 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -401,6 +401,7 @@ static NSTimeZone *serverTimeZone = nil; container = [self doesRetainContainer] ? [_container retain] : _container; userTimeZone = nil; + customOwner = nil; } return self; } @@ -410,6 +411,8 @@ static NSTimeZone *serverTimeZone = nil; } - (void)dealloc { + if (customOwner) + [customOwner release]; if ([self doesRetainContainer]) [container release]; if (userTimeZone) @@ -429,8 +432,15 @@ static NSTimeZone *serverTimeZone = nil; /* ownership */ +- (void) setOwner: (NSString *) newOwner +{ + ASSIGN (customOwner, newOwner); +} + - (NSString *)ownerInContext:(id)_ctx { - return [[self container] ownerInContext:_ctx]; + return ((customOwner) + ? customOwner + : [[self container] ownerInContext:_ctx]); } /* hierarchy */