From 4dbafd38dcb1c7e65c56ac4031e0beb9fdfc84b9 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 22 Jan 2010 20:05:40 +0000 Subject: [PATCH 1/2] See ChangeLog Monotone-Parent: b07d31699d6b961e69129af2d768322df3b7fee9 Monotone-Revision: dbc120865f7cb48891f7b017124443cc19de5f5c Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-01-22T20:05:40 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Contacts/UIxListView.m | 5 +++++ UI/Templates/ContactsUI/UIxListView.wox | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c6c7bec8..6f7552233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Francis Lachapelle + + * UI/Contacts/UIxListView.m (-itemHasEmail): new method that + returns YES if the current list item has an email address. + 2010-01-22 Wolfgang Sourdeau * Tools/SOGoToolRestore.m (+initialize): we need to invoke diff --git a/UI/Contacts/UIxListView.m b/UI/Contacts/UIxListView.m index 230db6bd3..36cacca6a 100644 --- a/UI/Contacts/UIxListView.m +++ b/UI/Contacts/UIxListView.m @@ -61,6 +61,11 @@ return [list cardReferences]; } +- (BOOL) itemHasEmail +{ + return [[item email] length] > 0; +} + - (NSString *) itemHref { return [NSString stringWithFormat: @"mailto:%@", diff --git a/UI/Templates/ContactsUI/UIxListView.wox b/UI/Templates/ContactsUI/UIxListView.wox index f47dbcc97..c0a7a8552 100644 --- a/UI/Templates/ContactsUI/UIxListView.wox +++ b/UI/Templates/ContactsUI/UIxListView.wox @@ -20,8 +20,8 @@ From 544a6ca798643dc2f143fe5c60238f9f2cb6b907 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 22 Jan 2010 20:12:21 +0000 Subject: [PATCH 2/2] See ChangeLog Monotone-Parent: dbc120865f7cb48891f7b017124443cc19de5f5c Monotone-Revision: 98e797e237e41e316f67dab068ddf038cdcc0b9a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-01-22T20:12:21 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ UI/Contacts/UIxListEditor.m | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f7552233..d387299be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-01-22 Francis Lachapelle + * UI/Contacts/UIxListEditor.m (-references): avoid printing the + email address between brackets if not defined. + * UI/Contacts/UIxListView.m (-itemHasEmail): new method that returns YES if the current list item has an email address. diff --git a/UI/Contacts/UIxListEditor.m b/UI/Contacts/UIxListEditor.m index 5e116ff94..2007b6515 100644 --- a/UI/Contacts/UIxListEditor.m +++ b/UI/Contacts/UIxListEditor.m @@ -79,8 +79,12 @@ { ref = [[list cardReferences] objectAtIndex: i]; row = [NSMutableDictionary dictionary]; - [row setObject: [NSString stringWithFormat: @"%@ <%@>", [ref fn], [ref email]] - forKey: @"name"]; + if ([[ref email] length] > 0) + [row setObject: [NSString stringWithFormat: @"%@ <%@>", [ref fn], [ref email]] + forKey: @"name"]; + else + [row setObject: [ref fn] + forKey: @"name"]; [row setObject: [ref reference] forKey: @"id"]; [rc addObject: row]; }