From 77e4b3307fa9bd89afc4c20ff664f59f1ca02e47 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Sat, 17 Nov 2012 15:33:07 -0500 Subject: [PATCH] Fix for bug #2106 --- SOPE/NGCards/CardElement.m | 11 +++++++---- SoObjects/Contacts/NGVCard+SOGo.m | 5 +++-- SoObjects/Contacts/NSDictionary+LDIF.m | 2 +- SoObjects/Contacts/SOGoContactLDIFEntry.m | 2 +- UI/Contacts/UIxContactFolderActions.m | 7 ++++--- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/SOPE/NGCards/CardElement.m b/SOPE/NGCards/CardElement.m index 552f4cbfa..834caf671 100644 --- a/SOPE/NGCards/CardElement.m +++ b/SOPE/NGCards/CardElement.m @@ -424,16 +424,19 @@ } static inline BOOL -_subValuesAreVoid (NSArray *subValues) +_subValuesAreVoid (id subValues) { BOOL result = YES; NSUInteger count, max; result = YES; - max = [subValues count]; - for (count = 0; result && count < max; count++) - result = ([[subValues objectAtIndex: count] length] == 0); + if ([subValues isKindOfClass: [NSArray class]]) + { + max = [subValues count]; + for (count = 0; result && count < max; count++) + result = ([[subValues objectAtIndex: count] length] == 0); + } return result; } diff --git a/SoObjects/Contacts/NGVCard+SOGo.m b/SoObjects/Contacts/NGVCard+SOGo.m index b306e0170..3419dea0f 100644 --- a/SoObjects/Contacts/NGVCard+SOGo.m +++ b/SoObjects/Contacts/NGVCard+SOGo.m @@ -227,7 +227,7 @@ convention: additional: nil prefixes: nil suffixes: nil]; [self setNickname: [ldifRecord objectForKey: @"mozillanickname"]]; [self setFn: [ldifRecord objectForKey: @"displayname"]]; - [self setTitle: [ldifRecord objectForKey: @"title"]]; + [self setTitle: [ldifRecord objectForKey: @"title"]]; element = [self _elementWithTag: @"adr" ofType: @"home"]; [element setSingleValue: [ldifRecord objectForKey: @"mozillahomestreet2"] @@ -303,7 +303,8 @@ convention: forKey: @""]; [self setNote: [ldifRecord objectForKey: @"description"]]; - [self setCategories: [ldifRecord objectForKey: @"vcardcategories"]]; + [self setCategories: [[ldifRecord objectForKey: @"vcardcategories"] + componentsSeparatedByString: @","]]; [self cleanupEmptyChildren]; } diff --git a/SoObjects/Contacts/NSDictionary+LDIF.m b/SoObjects/Contacts/NSDictionary+LDIF.m index f475c0fc5..dd7a6e539 100644 --- a/SoObjects/Contacts/NSDictionary+LDIF.m +++ b/SoObjects/Contacts/NSDictionary+LDIF.m @@ -1,6 +1,6 @@ /* NSDictionary+LDIF.m - this file is part of SOGo * - * Copyright (C) 2011 Inverse inc + * Copyright (C) 2011-2012 Inverse inc * * Author: Wolfgang Sourdeau * diff --git a/SoObjects/Contacts/SOGoContactLDIFEntry.m b/SoObjects/Contacts/SOGoContactLDIFEntry.m index 4472ae901..dc8ec3431 100644 --- a/SoObjects/Contacts/SOGoContactLDIFEntry.m +++ b/SoObjects/Contacts/SOGoContactLDIFEntry.m @@ -1,6 +1,6 @@ /* SOGoContactLDIFEntry.m - this file is part of SOGo * - * Copyright (C) 2006-2011 Inverse inc. + * Copyright (C) 2006-2012 Inverse inc. * * Author: Wolfgang Sourdeau * Ludovic Marcotte diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index a8831a12c..8e2bde448 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -1,14 +1,15 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2006-2012 Inverse inc. - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.