diff --git a/ChangeLog b/ChangeLog index c9f2de516..c017451cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-04-02 Wolfgang Sourdeau + * UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector + -calendarFolders]): we now take the list of subscribed calendar + from the container. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -calendarFoldersInContext:context]): new method derived from and replacing [UIxCalView calendarFolders]. diff --git a/UI/Scheduler/UIxCalendarSelector.h b/UI/Scheduler/UIxCalendarSelector.h index 3d15fc774..410ce6dbb 100644 --- a/UI/Scheduler/UIxCalendarSelector.h +++ b/UI/Scheduler/UIxCalendarSelector.h @@ -32,7 +32,6 @@ @interface UIxCalendarSelector : UIxComponent { - NSMutableArray *calendarFolders; NSMutableDictionary *colors; NSDictionary *currentCalendarFolder; @@ -40,6 +39,7 @@ } - (NSArray *) calendarFolders; + - (void) setCurrentCalendarFolder: (NSDictionary *) newCurrentCalendarFolder; - (NSDictionary *) currentCalendarFolder; diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m index ab6b124a1..d28e94847 100644 --- a/UI/Scheduler/UIxCalendarSelector.m +++ b/UI/Scheduler/UIxCalendarSelector.m @@ -31,6 +31,7 @@ #import #import #import +#import #import "UIxCalendarSelector.h" @@ -90,8 +91,7 @@ colorForNumber (unsigned int number) { if ((self = [super init])) { - colors = [NSMutableDictionary new]; - calendarFolders = nil; + colors = nil; currentCalendarFolder = nil; } @@ -100,34 +100,35 @@ colorForNumber (unsigned int number) - (void) dealloc { - [calendarFolders release]; [currentCalendarFolder release]; [colors release]; [super dealloc]; } -- (void) setCalendarFolders: (NSArray *) newCalendarFolders +- (NSArray *) calendarFolders { + NSArray *calendarFolders; NSEnumerator *newFolders; NSDictionary *currentFolder; unsigned int count; - ASSIGN (calendarFolders, newCalendarFolders); - - newFolders = [calendarFolders objectEnumerator]; - currentFolder = [newFolders nextObject]; - count = 0; - while (currentFolder) + calendarFolders + = [[self clientObject] calendarFoldersInContext: context]; + if (!colors) { - [colors setObject: colorForNumber (count) - forKey: [currentFolder objectForKey: @"folder"]]; - count++; + colors = [NSMutableDictionary new]; + count = 0; + newFolders = [calendarFolders objectEnumerator]; currentFolder = [newFolders nextObject]; + while (currentFolder) + { + [colors setObject: colorForNumber (count) + forKey: [currentFolder objectForKey: @"folder"]]; + count++; + currentFolder = [newFolders nextObject]; + } } -} -- (NSArray *) calendarFolders -{ return calendarFolders; }