Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added remaining source code and units tests for the MEMBER vCard property in ContactD...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 10 Dec 2015 21:19:55 +0000 (21:19 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 10 Dec 2015 21:19:55 +0000 (21:19 +0000)
source/contacteditor/ContactDataObject.cpp
source/contacteditor/ContactDataObject.h
source/tests/LoadCheck-Load4.vcf
source/tests/xestiaab_contactload.h

index 8fb6a39..9ced5ea 100644 (file)
@@ -290,6 +290,11 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe
                
                        }
                
+               } else if (PropertyName == wxT("MEDIATYPE")){
+
+                       GroupsListMediaType.erase(*GroupCount);
+                       GroupsListMediaType.insert(std::make_pair(*GroupCount, PropertyValue));
+               
                } else if (!PropertyName.IsEmpty() && !PropertyValue.IsEmpty()){
                        
                        if (FirstToken == TRUE){
@@ -311,6 +316,12 @@ void ContactDataObject::ProcessMember(wxString PropertySeg1, wxString PropertySe
 
        GroupsList.insert(std::make_pair(*GroupCount, PropertySeg2));
 
+       if (!PropertyTokens.IsEmpty()){
+       
+               GroupsListTokens.insert(std::make_pair(*GroupCount, PropertyTokens));
+       
+       }
+
 
 }
 
index 0792954..cd53dc9 100644 (file)
@@ -468,6 +468,7 @@ class ContactDataObject{
        std::map<int, wxString> GroupsListAltID;
        std::map<int, wxString> GroupsListPID;
        std::map<int, wxString> GroupsListType;
+       std::map<int, wxString> GroupsListMediaType;
        std::map<int, wxString> GroupsListTokens;
        std::map<int, int> GroupsListPref;
        
index 8785a45..df2a91a 100644 (file)
@@ -1,6 +1,7 @@
 BEGIN:VCARD
 VERSION:4.0
 KIND:individual
-MEMBER;ALTID=35;PID=40;PREF=45:7a2af44d-6431-4797-a55f-d86d56304fda
+MEMBER;ALTID=35;PID=40;PREF=45;MEDIATYPE=text/plain;EXAMPLE=Meep:7a2af44d-64
+ 31-4797-a55f-d86d56304fda
 FN:Test
 END:VCARD
index f40eeb9..d7c1210 100644 (file)
@@ -76,6 +76,19 @@ TEST(ContactLoad, ContactLoadTests){
        TestFileIntIter = TestFile.GroupsListPref.find(0);
        ASSERT_NE(TestFile.GroupsListPref.end(), TestFileIntIter);
        ASSERT_EQ(45, TestFileIntIter->second);
+       
+       // Check that MEDIATYPE parameter.
+       
+       TestFileIter = TestFile.GroupsListMediaType.find(0);
+       ASSERT_NE(TestFile.GroupsListMediaType.end(), TestFileIter);
+       ASSERT_EQ("text/plain", TestFileIter->second);
+       
+       // Check the extra tokens parameter.
+       
+       TestFileIter = TestFile.GroupsListTokens.find(0);
+       ASSERT_NE(TestFile.GroupsListTokens.end(), TestFileIter);
+       ASSERT_EQ("EXAMPLE=Meep", TestFileIter->second);
+       
 
 }
 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy