diff --git a/ChangeLog b/ChangeLog index 09f2ec57c..3b2992c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-01-16 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoCache.m ([SOGoCache + -registerObject:objectwithName:nameinContainer:container]): + register the object and its parents too. + * SoObjects/SOGo/SOGoUser.m ([SOGoUser +userWithLogin:newLoginroles:newRoles]): try to retrieve the specified user from the SOGoCache. diff --git a/SoObjects/SOGo/SOGoCache.m b/SoObjects/SOGo/SOGoCache.m index 2336020d8..8a33c76cf 100644 --- a/SoObjects/SOGo/SOGoCache.m +++ b/SoObjects/SOGo/SOGoCache.m @@ -92,11 +92,20 @@ static SOGoCache *sharedCache = nil; { NSString *fullPath; - if (object) + if (object && name) { + [self registerObject: container + withName: [container nameInContainer] + inContainer: [container container]]; fullPath = [self _pathFromObject: container withName: name]; - [cache setObject: object forKey: fullPath]; + if (![cache objectForKey: fullPath]) + { +// NSLog (@"registering '%@'", fullPath); + [cache setObject: object forKey: fullPath]; + } +// else +// NSLog (@"'%@' already registered", fullPath); } } @@ -109,18 +118,20 @@ static SOGoCache *sharedCache = nil; withName: name]; return [cache objectForKey: fullPath]; +// if (object) +// NSLog (@"found cached object '%@'", fullPath); } - (void) registerUser: (SOGoUser *) user { - NSLog (@"registerUser: %@", user); +// NSLog (@"registerUser: %@", user); [users setObject: user forKey: [user login]]; } - (id) userNamed: (NSString *) name { - NSLog (@"userNamed: %@", name); +// NSLog (@"userNamed: %@", name); return [users objectForKey: name]; }