diff --git a/ChangeLog b/ChangeLog index b16eb5e4d..a4c799c2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-09-14 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([-deleteEntriesWithIds:ids]): moved method into SOGoFolder. + * UI/Scheduler/UIxCalMainView.m ([-batchDeleteAction]): moved method into UIxFolderActions. diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.h b/SoObjects/Appointments/SOGoAppointmentFolder.h index 06edea0e6..5f5ee41d6 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -84,8 +84,6 @@ - (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate; -- (void) deleteEntriesWithIds: (NSArray *) ids; - /* URL generation */ - (NSString *) baseURLForAptWithUID: (NSString *) _uid diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 38c34a943..a517d18df 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -933,26 +933,6 @@ static NSNumber *sharedYes = nil; component: _component]; } -- (void) deleteEntriesWithIds: (NSArray *) ids -{ - Class objectClass; - unsigned int count, max; - NSString *currentId; - id deleteObject; - - max = [ids count]; - for (count = 0; count < max; count++) - { - currentId = [ids objectAtIndex: count]; - objectClass - = [self objectClassForResourceNamed: currentId]; - deleteObject = [objectClass objectWithName: currentId - inContainer: self]; - [deleteObject delete]; - [deleteObject primaryDelete]; - } -} - /* URL generation */ - (NSString *) baseURLForAptWithUID: (NSString *)_uid diff --git a/SoObjects/SOGo/SOGoFolder.h b/SoObjects/SOGo/SOGoFolder.h index ed57b8059..ccca8e7d7 100644 --- a/SoObjects/SOGo/SOGoFolder.h +++ b/SoObjects/SOGo/SOGoFolder.h @@ -66,6 +66,8 @@ /* lower level fetches */ - (BOOL) nameExistsInFolder: (NSString *) objectName; +- (void) deleteEntriesWithIds: (NSArray *) ids; + - (NSArray *) fetchContentObjectNames; - (NSDictionary *) fetchContentStringsAndNamesOfAllObjects; diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index a78d50740..e0845f826 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -45,6 +45,7 @@ #import "NSArray+Utilities.h" #import "NSString+Utilities.h" +#import "SOGoContentObject.h" #import "SOGoPermissions.h" #import "SOGoUser.h" @@ -338,6 +339,22 @@ static NSString *defaultUserID = @""; && [records count] > 0); } +- (void) deleteEntriesWithIds: (NSArray *) ids +{ + unsigned int count, max; + NSString *currentID; + SOGoContentObject *deleteObject; + + max = [ids count]; + for (count = 0; count < max; count++) + { + currentID = [ids objectAtIndex: count]; + deleteObject = [self lookupName: currentID + inContext: context acquire: NO]; + [deleteObject delete]; + } +} + - (NSDictionary *) fetchContentStringsAndNamesOfAllObjects { NSDictionary *files;