diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.h b/SoObjects/Contacts/SOGoContactGCSFolder.h index 71113a6f8..1dd91a53b 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.h +++ b/SoObjects/Contacts/SOGoContactGCSFolder.h @@ -22,10 +22,12 @@ #ifndef __Contacts_SOGoContactGCSFolder_H__ #define __Contacts_SOGoContactGCSFolder_H__ -#import +#import + #import "SOGoContactFolder.h" -@class NSString, NSArray; +@class NSArray; +@class NSString; @interface SOGoContactGCSFolder : SOGoFolder { diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index b050b7a43..42d966dc7 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -47,24 +47,21 @@ return folder; } -- (id ) initWithName: (NSString *) aName - andDisplayName: (NSString *) aDisplayName - inContainer: (SOGoObject *) aContainer +- (void) dealloc { - if ((self = [self initWithName: aName - inContainer: aContainer])) - [self setDisplayName: aDisplayName]; - - return self; + [displayName release]; + [super dealloc]; } -- (void) setDisplayName: (NSString *) aDisplayName +- (id ) initWithName: (NSString *) newName + andDisplayName: (NSString *) newDisplayName + inContainer: (SOGoObject *) newContainer { - if (displayName) - [displayName release]; - displayName = aDisplayName; - if (displayName) - [displayName retain]; + if ((self = [self initWithName: newName + inContainer: newContainer])) + ASSIGN (displayName, newDisplayName); + + return self; } - (NSString *) displayName @@ -156,7 +153,7 @@ qualifier = [self _qualifierForFilter: filter]; records = [[self ocsFolder] fetchFields: fields matchingQualifier: qualifier]; - if (records) + if ([records count] > 1) { ordering = [EOSortOrdering sortOrderingWithKey: sortKey