Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CONTACT property for saving data from a CalendarTaskObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 22:10:20 +0000 (23:10 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 22:10:20 +0000 (23:10 +0100)
Added the code and unit tests for the CONTACT property.

source/objects/calendartask/CalendarTask-Save.cpp
source/tests/xestiacalendar_icaltasksave.h

index a2ce377..ecf2362 100644 (file)
@@ -927,6 +927,52 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the CONTACT value.
+       
+       if (ContactList.size() > 0){
+               
+               for (int ContactListSeek = 0; ContactListSeek < ContactList.size();
+                       ContactListSeek++){
+       
+                       DataLine += "CONTACT";
+                       
+                       if (ContactListAltRep[ContactListSeek].size() > 0){
+               
+                               DataLine += ";ALTREP=\"";
+                               DataLine += ContactListAltRep[ContactListSeek];
+                               DataLine += "\"";
+                       
+                       }
+                               
+                       if (ContactListLanguage[ContactListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += ContactListLanguage[ContactListSeek];
+                       
+                       }
+                       
+                       if (ContactListTokens[ContactListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += ContactListTokens[ContactListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += ContactList[ContactListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VTODO\n";
        
 }
\ No newline at end of file
index fd65771..4313604 100644 (file)
@@ -100,6 +100,9 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        "COMMENT:This is the first comment.\n"
        "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=en:This is the second comment.\n"
        "COMMENT;ZEBRAS=YES:This is the third comment.\n"
+       "CONTACT:First Contact\n"
+       "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB:Second Contact\n"
+       "CONTACT;ZEBRAS=NO:Third Contact\n"
        "END:VTODO\n"
        "END:VCALENDAR";
        
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