Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added COMMENT property for saving data from a CalendarTimezoneObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 11 Jun 2016 10:00:07 +0000 (11:00 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 11 Jun 2016 10:00:07 +0000 (11:00 +0100)
Added the code and unit tests for the COMMENT property in both
STANDARD and DAYLIGHT timezone types.

source/objects/calendartimezone/CalendarTimezone-Save.cpp
source/tests/xestiacalendar_icaltimezonesave.h

index 127ac00..2dc194e 100644 (file)
@@ -213,6 +213,52 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the COMMENT value.
+       
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].CommentList.size() > 0){
+               
+                               for (int CommentListSeek = 0; CommentListSeek < TimezoneStandardCollection[TimezoneStandardSeek].CommentList.size();
+                                       CommentListSeek++){
+       
+                                       DataLine += "COMMENT";
+                       
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].CommentListAltRep[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";ALTREP=\"";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].CommentListAltRep[CommentListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+                               
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].CommentListLanguage[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";LANGUAGE=";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].CommentListLanguage[CommentListSeek];
+                       
+                                       }
+                       
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].CommentListTokens[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].CommentListTokens[CommentListSeek];
+                       
+                                       }
+                               
+                                       DataLine += ":";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].CommentList[CommentListSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                               
+                               }
+               
+                       }
                                
                        *SaveData += "END:STANDARD\n";
                                
@@ -340,6 +386,52 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the COMMENT value.
+       
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].CommentList.size() > 0){
+               
+                               for (int CommentListSeek = 0; CommentListSeek < TimezoneDaylightCollection[TimezoneDaylightSeek].CommentList.size();
+                                       CommentListSeek++){
+       
+                                       DataLine += "COMMENT";
+                       
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListAltRep[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";ALTREP=\"";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListAltRep[CommentListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+                               
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListLanguage[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";LANGUAGE=";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListLanguage[CommentListSeek];
+                       
+                                       }
+                       
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListTokens[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].CommentListTokens[CommentListSeek];
+                       
+                                       }
+                               
+                                       DataLine += ":";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].CommentList[CommentListSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                               
+                               }
+               
+                       }
                                
                        *SaveData += "END:DAYLIGHT\n";
                                
index cf2266d..abeb5b9 100644 (file)
@@ -79,6 +79,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "TZOFFSETFROM;LETS=GO:-0500\n"
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
+       "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
@@ -95,6 +96,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "TZOFFSETFROM;LETS=GO:-0500\n"
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
+       "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
        "END:DAYLIGHT\n"
        "END:VTIMEZONE\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