From 3bdf3aacdef197d8a716e8dc043b1a6efc34f5ee Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 13 Oct 2009 21:40:18 +0000 Subject: [PATCH 1/4] Monotone-Parent: 5244339e45ef9095573b10733228f85b81a17377 Monotone-Revision: 88abde23827bf8224db16cc732418d143787b3f6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-13T21:40:18 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/MailPartViewers/UIxMailPartICalActions.m | 2 +- UI/Scheduler/UIxAppointmentEditor.m | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 27a01963d..f8eea562b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-10-13 Wolfgang Sourdeau + * UI/Scheduler/UIxAppointmentEditor.m (-delegateAction): same as + below. + + * UI/MailPartViewers/UIxMailPartICalActions.m (-delegateAction): + delegatedAttendee is autoreleased to avoid a leak. + * SoObjects/SOGo/LDAPSource.m (-dealloc): we release the "searchAttributes" ivar, even though LDAPSource instances are never deallocated. diff --git a/UI/MailPartViewers/UIxMailPartICalActions.m b/UI/MailPartViewers/UIxMailPartICalActions.m index 9e7ebe283..1cd8a956e 100644 --- a/UI/MailPartViewers/UIxMailPartICalActions.m +++ b/UI/MailPartViewers/UIxMailPartICalActions.m @@ -264,6 +264,7 @@ { user = [context activeUser]; delegatedAttendee = [iCalPerson new]; + [delegatedAttendee autorelease]; [delegatedAttendee setEmail: delegatedEmail]; delegatedUid = [delegatedAttendee uid]; if (delegatedUid) @@ -272,7 +273,6 @@ delegatedUser = [SOGoUser userWithLogin: delegatedUid]; [delegatedAttendee setCn: [delegatedUser cn]]; } - [delegatedAttendee setRole: @"REQ-PARTICIPANT"]; [delegatedAttendee setRsvp: @"TRUE"]; [delegatedAttendee setParticipationStatus: iCalPersonPartStatNeedsAction]; diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index e59596105..5033c425d 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -547,6 +547,7 @@ { user = [context activeUser]; delegatedAttendee = [iCalPerson new]; + [delegatedAttendee autorelease]; [delegatedAttendee setEmail: delegatedEmail]; delegatedUid = [delegatedAttendee uid]; if (delegatedUid) From 4a3f7e384f1da09455ad0e27cb49a189376f0f39 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 14 Oct 2009 12:01:29 +0000 Subject: [PATCH 2/4] Monotone-Parent: 88abde23827bf8224db16cc732418d143787b3f6 Monotone-Revision: bcf0244d358523a4f4d16339d9ea38d4ce1114e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-14T12:01:29 Monotone-Branch: ca.inverse.sogo --- UI/MainUI/SOGoUserHomePage.m | 3 +-- UI/SOGoUI/SOGoAptFormatter.m | 3 +-- UI/Scheduler/UIxTimeDateControl.m | 8 ++------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index 02de6ad66..3d2b8f12a 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -323,7 +323,7 @@ static NSString *LDAPContactInfoAttribute = nil; [response setHeader: @"text/plain; charset=utf-8" forKey: @"Content-Type"]; - responseString = [NSMutableString new]; + responseString = [NSMutableString string]; // We sort our array - this is pretty useful for the Web // interface of SOGo. @@ -353,7 +353,6 @@ static NSString *LDAPContactInfoAttribute = nil; } } [response appendContentString: responseString]; - [responseString release]; return response; } diff --git a/UI/SOGoUI/SOGoAptFormatter.m b/UI/SOGoUI/SOGoAptFormatter.m index 3c5c4b54b..dbd49401d 100644 --- a/UI/SOGoUI/SOGoAptFormatter.m +++ b/UI/SOGoUI/SOGoAptFormatter.m @@ -240,8 +240,7 @@ NSCalendarDate *startDate; NSTimeZone *dtz; - title = [NSMutableString new]; - [title autorelease]; + title = [NSMutableString string]; dtz = [self displayTZ]; startDate = [_apt valueForKey: @"startDate"]; diff --git a/UI/Scheduler/UIxTimeDateControl.m b/UI/Scheduler/UIxTimeDateControl.m index c36b85385..cc768cb2b 100644 --- a/UI/Scheduler/UIxTimeDateControl.m +++ b/UI/Scheduler/UIxTimeDateControl.m @@ -176,9 +176,7 @@ NSMutableArray *hours; unsigned int h; - hours = [NSMutableArray new]; - [hours autorelease]; - + hours = [NSMutableArray array]; for (h = startHour; h < (endHour + 1); h++) [hours addObject: [NSNumber numberWithInt: h]]; @@ -210,9 +208,7 @@ NSMutableArray *minutes; unsigned int m; - minutes = [NSMutableArray new]; - [minutes autorelease]; - + minutes = [NSMutableArray array]; for (m = 0; m < 60; m += 15) [minutes addObject: [NSNumber numberWithInt: m]]; From e5d8de7d5c9a3e93c7370a1e15309ec5d8717b12 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 14 Oct 2009 12:01:59 +0000 Subject: [PATCH 3/4] Monotone-Parent: bcf0244d358523a4f4d16339d9ea38d4ce1114e2 Monotone-Revision: b246c3979cba84d0c46cb39e0141ae390baaea7a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-14T12:01:59 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ UI/PreferencesUI/UIxPreferences.m | 15 +++++++-------- UI/Scheduler/UIxComponentEditor.m | 3 ++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8eea562b..e8e8fa13c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2009-10-13 Wolfgang Sourdeau + * UI/Scheduler/UIxComponentEditor.m (-setComponent:): we invoke + _loadAttendee only when "jsonAttendees" is not set, even though + that condition should always be true. + + * UI/PreferencesUI/UIxPreferences.m (-setCategoriesValue): we use + [self errorWithFormat:] rather than NSLog to output + deserialization errors. + * UI/Scheduler/UIxAppointmentEditor.m (-delegateAction): same as below. diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index a492bc168..69412c79c 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -30,6 +30,8 @@ #import #import +#import + #import #import #import @@ -369,8 +371,7 @@ static BOOL forwardEnabled = NO; NSMutableArray *daysList; unsigned int currentDay; - daysList = [NSMutableArray new]; - [daysList autorelease]; + daysList = [NSMutableArray array]; for (currentDay = 0; currentDay < 7; currentDay++) [daysList addObject: [NSString stringWithFormat: @"%d", currentDay]]; @@ -751,8 +752,7 @@ static BOOL forwardEnabled = NO; addressesList = [vacationOptions objectForKey: @"autoReplyEmailAddresses"]; if (!addressesList) { - newAddressesList = [NSMutableArray new]; - [newAddressesList autorelease]; + newAddressesList = [NSMutableArray array]; addressesList = [NSMutableArray arrayWithArray: [user allEmails]]; for (i = 0; i < [addressesList count]; i++) { @@ -1031,10 +1031,10 @@ static BOOL forwardEnabled = NO; mutabilityOption: NSPropertyListImmutable format: &format errorDescription: &error]; - - if(!plist) + if (!plist) { - NSLog(error); + [self errorWithFormat: @"an error occured during deserialization" + @" of categories: %@", error]; [error release]; } else @@ -1045,7 +1045,6 @@ static BOOL forwardEnabled = NO; forKey: @"CalendarCategoriesColors"]; NSLog ([plist description]); } - } - (NSArray *) languages diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index abeeec8eb..e3b7fafac 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -550,7 +550,8 @@ iRANGE(2); ASSIGN (organizer, [component organizer]); [self _loadCategories]; - [self _loadAttendees]; + if (!jsonAttendees) + [self _loadAttendees]; [self _loadRRules]; [self _loadAlarms]; From 29e239bba010aaebbd605257446d91ed308b169b Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 14 Oct 2009 16:47:15 +0000 Subject: [PATCH 4/4] See ChangeLog Monotone-Parent: dfb0905a14bcb6b22ea2b02eb9910b1e098aeaa9 Monotone-Revision: 78eddfb311776e904d4f6650bcc5e2930af4519a Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-10-14T16:47:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Scheduler/UIxCalMainActions.m | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 75b0f0fc3..5a5eb0713 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-14 Ludovic Marcotte + + * UI/Scheduler/UIxCalMainActions.m + We store the string value of the URL in our + prefs, not the NSURL instance. + 2009-10-13 Ludovic Marcotte * SoObjects/SOGo/NSDictionary+BSJSONAdditions.m diff --git a/UI/Scheduler/UIxCalMainActions.m b/UI/Scheduler/UIxCalMainActions.m index 6cee2a8f6..965831bb3 100644 --- a/UI/Scheduler/UIxCalMainActions.m +++ b/UI/Scheduler/UIxCalMainActions.m @@ -118,7 +118,7 @@ webCalendars = [NSMutableDictionary dictionary]; [calSettings setObject: webCalendars forKey: @"WebCalendars"]; } - [webCalendars setObject: calendarURL forKey: calendarName]; + [webCalendars setObject: [calendarURL absoluteString] forKey: calendarName]; [settings synchronize]; }