From c6532f9d73295bbe54d831f4b17c84bccae35d04 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 15 Jul 2010 17:05:29 +0000 Subject: [PATCH] Monotone-Parent: e12c6a7ac6a504dcbea24890a7be8b72b8dc91a4 Monotone-Revision: a3bdc2441cad158c03e3bb175dd766004db14021 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-15T17:05:29 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ .../Appointments/SOGoAppointmentFolder.h | 1 - .../Appointments/SOGoAppointmentFolder.m | 34 ++----------------- .../Appointments/SOGoAppointmentObject.m | 6 ++-- 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ec8df6e7..81425048f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-07-15 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + (-lookupCalendarFolderForUID:): removed useless method, which can + be replaced with -[SOGoUser personalCalendarFolderInContext:]. + * UI/Scheduler/UIxCalListingActions.m (_aptFolder:withClientObject:): removed unused method. diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.h b/SoObjects/Appointments/SOGoAppointmentFolder.h index 7e88ebfb5..7c1e70f3b 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -123,7 +123,6 @@ typedef enum { - (id) lookupHomeFolderForUID: (NSString *) _uid inContext: (id) _ctx; -- (SOGoAppointmentFolder *) lookupCalendarFolderForUID: (NSString *) uid; - (NSArray *) lookupCalendarFoldersForUID: (NSString *) theUID; - (NSArray *) lookupCalendarFoldersForUIDs: (NSArray *) _uids inContext: (id) _ctx; diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index ee1a9d3af..70a8e3aaf 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2644,36 +2644,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return result; } -// -// This method returns the personal calendar of a specific user. -// -- (SOGoAppointmentFolder *) lookupCalendarFolderForUID: (NSString *) uid -{ - SOGoFolder *currentContainer; - SOGoAppointmentFolders *parent; - NSException *error; - - currentContainer = [[container container] container]; - currentContainer = [currentContainer lookupName: uid - inContext: context - acquire: NO]; - parent = [currentContainer lookupName: @"Calendar" inContext: context - acquire: NO]; - currentContainer = [parent lookupName: @"personal" inContext: context - acquire: NO]; - if (!currentContainer) - { - error = [parent newFolderWithName: [parent defaultFolderName] - andNameInContainer: @"personal"]; - if (!error) - currentContainer = [parent lookupName: @"personal" - inContext: context - acquire: NO]; - } - - return (SOGoAppointmentFolder *) currentContainer; -} - // // This method returns an array containing all the calendar folders // of a specific user, excluding her/his subscriptions. @@ -2712,6 +2682,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir NSMutableArray *folders; NSEnumerator *e; NSString *uid, *ownerLogin; + SOGoUser *user; id folder; ownerLogin = [self ownerInContext: context]; @@ -2725,7 +2696,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir folder = self; else { - folder = [self lookupCalendarFolderForUID: uid]; + user = [SOGoUser userWithLogin: uid]; + folder = [user personalCalendarFolderInContext: context]; if (![folder isNotNull]) [self logWithFormat:@"Note: did not find folder for uid: '%@'", uid]; } diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 896c23d2e..5e43eafc7 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -163,7 +163,8 @@ if (!object) { // Create the event in the user's personal calendar. - folder = [container lookupCalendarFolderForUID: uid]; + folder = [[SOGoUser userWithLogin: uid] + personalCalendarFolderInContext: context]; object = [SOGoAppointmentObject objectWithName: nameInContainer inContainer: folder]; [object setIsNew: YES]; @@ -265,7 +266,8 @@ // Invitations are always written to the personal folder; it's not necessay // to look into all folders of the user - folder = [container lookupCalendarFolderForUID: theUID]; + folder = [[SOGoUser userWithLogin: theUID] + personalCalendarFolderInContext: context]; object = [folder lookupName: nameInContainer inContext: context acquire: NO]; if (![object isKindOfClass: [NSException class]])