Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added COMMENT property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 17:48:17 +0000 (18:48 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 17:48:17 +0000 (18:48 +0100)
Added the code and unit tests for the COMMENT property.

source/objects/calendarevent/CalendarEvent-Save.cpp
source/tests/xestiacalendar_icaleventsave.h

index a2139fc..940c557 100644 (file)
@@ -851,6 +851,52 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the COMMENT value.
+       
+       if (CommentList.size() > 0){
+               
+               for (int CommentListSeek = 0; CommentListSeek < CommentList.size();
+                       CommentListSeek++){
+       
+                       DataLine += "COMMENT";
+                       
+                       if (CommentListAltRep[CommentListSeek].size() > 0){
+               
+                               DataLine += ";ALTREP=\"";
+                               DataLine += CommentListAltRep[CommentListSeek];
+                               DataLine += "\"";
+                       
+                       }
+                               
+                       if (CommentListLanguage[CommentListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += CommentListLanguage[CommentListSeek];
+                       
+                       }
+                       
+                       if (CommentListTokens[CommentListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += CommentListTokens[CommentListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += CommentList[CommentListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 2858f3f..06dd2a4 100644 (file)
@@ -110,6 +110,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "CATEGORIES;LANGUAGE=en:CATEGORY THREE, CATEGORY FOUR\n"
        "CATEGORIES;LANGUAGE=en-GB;SAMPLE=TOKEN:CATEGORY FIVE, CATEGORY SIX, CATEGORY \n"
        " SEVEN\n"
+       "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"
        "END:VEVENT\n"
        "END:VCARD";
 
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