From c9cebfec36e0ed76ede2cd6521ec116c3589c73d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 20 Apr 2010 19:34:50 +0000 Subject: [PATCH] Monotone-Parent: 4ea4ae7585400501c982fe23dd2f6bf83e26c233 Monotone-Revision: db9ec5b861b659354c77dd7978e1c7f78f92de3e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-04-20T19:34:50 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoUser.m | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a5b17094..7c45eb99c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-04-20 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUser.m (-mailAccounts): use the user's first + email address as displayname for the mail account. Also, we avoid + autoreleasing objects that do not required to. + * UI/MailPartViewers/UIxMailPartHTMLViewer.m (-startElement:namespace:rawName:attributes:): "ignoreContent" is no longer a BOOL but an int, and was renamed to "ignoredContent". diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 25c85b449..4f2b57596 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -438,47 +438,49 @@ { NSMutableDictionary *mailAccount, *identity; NSMutableArray *identities; - NSString *name, *fullName, *imapLogin, *imapServer; + NSString *fullName, *imapLogin, *imapServer; NSArray *mails; unsigned int count, max; if (!mailAccounts) { imapLogin = [[SOGoUserManager sharedUserManager] - getImapLoginForUID: login]; + getImapLoginForUID: login]; imapServer = [self _fetchFieldForUser: @"c_imaphostname"]; if (!imapServer) imapServer = [[self domainDefaults] imapServer]; - mailAccount = [NSMutableDictionary dictionary]; - name = [NSString stringWithFormat: @"%@@%@", - imapLogin, imapServer]; + mailAccount = [NSMutableDictionary new]; [mailAccount setObject: imapLogin forKey: @"userName"]; [mailAccount setObject: imapServer forKey: @"serverName"]; - [mailAccount setObject: name forKey: @"name"]; - identities = [NSMutableArray array]; + identities = [NSMutableArray new]; mails = [self allEmails]; + [mailAccount setObject: [mails objectAtIndex: 0] + forKey: @"name"]; max = [mails count]; if (max > 1) max--; for (count = 0; count < max; count++) { - identity = [NSMutableDictionary dictionary]; + identity = [NSMutableDictionary new]; fullName = [self cn]; if (![fullName length]) fullName = login; [identity setObject: fullName forKey: @"fullName"]; [identity setObject: [mails objectAtIndex: count] forKey: @"email"]; [identities addObject: identity]; + [identity release]; } [[identities objectAtIndex: 0] setObject: [NSNumber numberWithBool: YES] forKey: @"isDefault"]; [mailAccount setObject: identities forKey: @"identities"]; + [identities release]; mailAccounts = [NSArray arrayWithObject: mailAccount]; [mailAccounts retain]; + [mailAccount release]; } return mailAccounts;