From ea275e5681ca625a3d36a7f0c25c840cad0e41db Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 7 Oct 2009 20:24:54 +0000 Subject: [PATCH] Monotone-Parent: e06ea9bf29414e55d556171e1cc5c4a2d9c46894 Monotone-Revision: 64e278dc3fe577f3d357ff6947dc8efe939ce6ee Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-07T20:24:54 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/SOGo/SOGoParentFolder.h | 2 ++ SoObjects/SOGo/SOGoParentFolder.m | 16 +++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51d560f98..3e381738b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,13 @@ 2009-10-07 Wolfgang Sourdeau + 2009-10-07 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoParentFolder.m (-hasLocalSubfolderNamed): + rewritten parts of the method to better fit our coding standards. + Exported method in the SOGoParentFolder.h to avoid warnings where + it's used. + * SoObjects/Appointments/SOGoAppointmentFolders.m (_fetchPersonalFolders:withChannel:): we now skip unexisting folders declared in the list of web folder ids to avoid problems. diff --git a/SoObjects/SOGo/SOGoParentFolder.h b/SoObjects/SOGo/SOGoParentFolder.h index 270252054..bd5bee7de 100644 --- a/SoObjects/SOGo/SOGoParentFolder.h +++ b/SoObjects/SOGo/SOGoParentFolder.h @@ -47,6 +47,8 @@ - (NSArray *) toManyRelationshipKeys; - (NSArray *) subFolders; +- (BOOL) hasLocalSubFolderNamed: (NSString *) name; + - (NSException *) newFolderWithName: (NSString *) name andNameInContainer: (NSString *) newNameInContainer; - (NSException *) newFolderWithName: (NSString *) name diff --git a/SoObjects/SOGo/SOGoParentFolder.m b/SoObjects/SOGo/SOGoParentFolder.m index 66f1bcbeb..e4c6dfd77 100644 --- a/SoObjects/SOGo/SOGoParentFolder.m +++ b/SoObjects/SOGo/SOGoParentFolder.m @@ -446,19 +446,21 @@ static SoSecurityManager *sm = nil; { NSArray *subs; NSException *error; + NSString *currentDisplayName; int i, count; - BOOL rc = NO; + BOOL rc; + + rc = NO; error = [self initSubFolders]; - if (error) - [error raise]; subs = [subFolders allValues]; count = [subs count]; - - for (i = 0; i < count; i++) - if ([name isEqualToString: [[subs objectAtIndex: i] displayName]]) - rc = YES; + for (i = 0; !rc && i < count; i++) + { + currentDisplayName = [[subs objectAtIndex: i] displayName]; + rc = [name isEqualToString: currentDisplayName]; + } return rc; }