diff --git a/ChangeLog b/ChangeLog index 50faafb16..5b31dc2ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-09-26 Wolfgang Sourdeau + * UI/Contacts/UIxContactsListViewBase.m ([UIxContactsListViewBase + -displayName]): new method that returns the display name from "cn" + or from the "displayName" key if found. + * UI/Contacts/UIxContactEditor.m ([UIxContactEditor -initSnapshot]): check if "[card n]" returns anything to avoid a crash. diff --git a/UI/Contacts/UIxContactsListViewBase.m b/UI/Contacts/UIxContactsListViewBase.m index 557074f5a..b7401555b 100644 --- a/UI/Contacts/UIxContactsListViewBase.m +++ b/UI/Contacts/UIxContactsListViewBase.m @@ -38,12 +38,12 @@ /* accessors */ -- (void) setCurrentContact: (id ) _contact +- (void) setCurrentContact: (NSDictionary *) _contact { currentContact = _contact; } -- (id ) currentContact +- (NSDictionary *) currentContact { return currentContact; } @@ -66,6 +66,17 @@ return @"fn"; } +- (NSString *) displayName +{ + NSString *displayName; + + displayName = [currentContact objectForKey: @"displayName"]; + if (!(displayName && [displayName length] > 0)) + displayName = [currentContact objectForKey: @"cn"]; + + return displayName; +} + - (NSString *) sortKey { NSString *s;