diff --git a/ChangeLog b/ChangeLog index 17c99fd43..2ea57bdc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +<<<<<<< variant A +2012-01-27 Ludovic Marcotte + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (bareFetchFields: ...) - we now cache the returned + results - just like for fetchFields:... + + * SoObjects/Appointments/SOGoAppointmentFolderObject.m + (_folderCalenars) - we now ask for the c_content and use + a local autorelease pool to avoid consuming too much memory + +>>>>>>> variant B 2012-01-26 Wolfgang Sourdeau * OpenChange/MAPIStoreCommonViewsContext.[hm], @@ -26,6 +38,8 @@ (+listContextsForUser:inMemCtx:): new individual method invoked by the above. Overridden by concrete subclasses. +####### Ancestor +======= end 2012-01-26 Ludovic Marcotte * SoObjects/SOGo/LDAPSource.{h,m} - now honor diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index b9a3f8700..882f5cac9 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -558,6 +558,11 @@ static NSNumber *sharedYes = nil; } else records = [NSArray array]; + + if ([self _checkIfWeCanRememberRecords: fields]) + { + [self _rememberRecords: records]; + } return records; } diff --git a/SoObjects/Appointments/SOGoAppointmentFolderObject.m b/SoObjects/Appointments/SOGoAppointmentFolderObject.m index 112c26ea6..8cde6867e 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolderObject.m +++ b/SoObjects/Appointments/SOGoAppointmentFolderObject.m @@ -1,6 +1,6 @@ /* SOGoAppointmentFolderObject.m - this file is part of SOGo * - * Copyright (C) 2010 Inverse inc. + * Copyright (C) 2010-2012 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -21,6 +21,7 @@ */ #import +#import #import #import #import @@ -50,7 +51,7 @@ static NSArray *contentFields = nil; if (!contentFields) contentFields = [[NSArray alloc] initWithObjects: @"c_name", @"c_version", @"c_lastmodified", @"c_creationdate", - @"c_component", nil]; + @"c_component", @"c_content", nil]; } - (id) init @@ -181,6 +182,7 @@ static NSArray *contentFields = nil; NSArray *records; NSMutableArray *calendars; SOGoCalendarComponent *component; + NSAutoreleasePool *pool; int count, max; iCalCalendar *calendar; NSString *name; @@ -188,8 +190,19 @@ static NSArray *contentFields = nil; records = [self _fetchFolderRecords]; max = [records count]; calendars = [NSMutableArray arrayWithCapacity: max]; + pool = nil; + + // This can consume a significant amount of memory so + // we use a local autorelease pool to avoid running + // out of memory. for (count = 0; count < max; count++) { + if (count % 100 == 0) + { + RELEASE(pool); + pool = [[NSAutoreleasePool alloc] init]; + } + name = [[records objectAtIndex: count] objectForKey: @"c_name"]; component = [folder lookupName: name inContext: context @@ -202,6 +215,8 @@ static NSArray *contentFields = nil; @" be listed here", name]; } + RELEASE(pool); + return calendars; }