From 7e481c05366a859892c7081a00d0d02adf72d08e Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 29 Jun 2016 08:01:46 +0100 Subject: [PATCH] Added KIND to the SaveString function of ContactDataObject --- .../cdo/ContactDataObject-Save.cpp | 23 +++++++++++++++++++ source/tests/xestiaab_contactsave.h | 1 + 2 files changed, 24 insertions(+) diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 0b059ea..73fb904 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -55,6 +55,29 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ ProcessData.clear(); } + + // Process KIND. + + switch(ContactKind){ + + case CONTACTKIND_NONE: + break; + case CONTACTKIND_INDIVIDUAL: + SaveData->Append("KIND:individual\n"); + break; + case CONTACTKIND_GROUP: + SaveData->Append("KIND:group\n"); + break; + case CONTACTKIND_ORGANISATION: + SaveData->Append("KIND:org\n"); + break; + case CONTACTKIND_LOCATION: + SaveData->Append("KIND:location\n"); + break; + default: + break; + + } // Process FN. diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index f82fd22..cff2a98 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -61,6 +61,7 @@ TEST(ContactSave, ContactSaveTests){ "VERSION:4.0\n" "PRODID:-//Xestia//Address Book Unit Testing//KW\n" "UID:903588-9082374-989120310-AAFECDBCDF\n" + "KIND:individual\n" "FN;TYPE=work;LANGUAGE=kw;ALTID=500;PID=40;PREF=45;EXAMPLE=Baaa:Test Contact\n" "TITLE;ALTID=20;LANGUAGE=text/plain;PID=21;PREF=22;EEP=LIGHT:Lord of Light\n" "TITLE;TYPE=home;ALTID=30;LANGUAGE=grass/dry;PID=31;PREF=32;EEP=DARK:Lord of D\n" -- 2.39.5