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

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

index 80d02fc..7a1fbba 100644 (file)
@@ -149,6 +149,48 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the DESCRIPTION values. Write out the
+       // first DESCRPITION only as per RFC5545 specifcation.
+       
+       if (DescriptionList.size() > 0){
+               
+               DataLine += "DESCRIPTION";
+               
+               if (DescriptionListAltRep[0].size() > 0){
+               
+                       DataLine += ";ALTREP=\"";
+                       DataLine += DescriptionListAltRep[0];
+                       DataLine += "\"";
+                       
+               }
+               
+               if (DescriptionListLanguage[0].size() > 0){
+               
+                       DataLine += ";LANGUAGE=";
+                       DataLine += DescriptionListLanguage[0];
+                       
+               }
+               
+               if (DescriptionListTokens[0].size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += DescriptionListTokens[0];
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DescriptionList[0];
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VTODO\n";
        
 }
\ No newline at end of file
index af26f79..9a39ea3 100644 (file)
@@ -61,6 +61,8 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        "CLASS;CHOCOLATE=NONE:PUBLIC\n"
        "COMPLETED;LYING=NEVER:20160131T110100Z\n"
        "CREATED;CARAMEL=PLEASE:20160131T080000Z\n"
+       "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n"
+       " is a description of the todo.\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