From cade28b75c1dfc7b98b5a791d23812a395c3dfd0 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 11 Jan 2010 18:38:44 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 32e14dc57c4f6d9a43de5dfdf3c298091cbf84ea Monotone-Revision: 761144933c016dd4448ac0614c3937621750bda6 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-01-11T18:38:44 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Contacts/UIxContactFolderActions.m | 22 ++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b48dc1a9..86637bd88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-11 Ludovic Marcotte + + * UI/Contacts/UIxContactFolderActions.m (-importVcardData:): + We now support multiple vCards in the same file during + the import process + 2010-01-08 Ludovic Marcotte * SoObjects/SOGo/LDAPSource.{h,m} - bindFields is now diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index 94a47e541..c8081fd5c 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -194,13 +194,27 @@ - (int) importVcardData: (NSString *) vcardData { - NGVCard *card; + NSArray *allCards; int rc; rc = 0; - card = [NGVCard parseSingleFromSource: vcardData]; - if ([self importVcard: card]) - rc = 1; + allCards = [NGVCard parseFromSource: vcardData]; + + if (allCards && [allCards count]) + { + int i; + + for (i = 0; i < [allCards count]; i++) + { + if (![self importVcard: [allCards objectAtIndex: i]]) + { + rc = 0; + break; + } + else + rc++; + } + } return rc; }