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

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

index 330df3b..9e143ce 100644 (file)
@@ -1334,6 +1334,32 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                                
                        }
                        
+                       // Process the REPEAT VALARM value.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].RepeatData.size() > 0){
+                               
+                               DataLine += "REPEAT";
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].RepeatTokens.size() > 0){
+               
+                                       DataLine += ";";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].RepeatTokens;
+                       
+                               }
+                               
+                               DataLine += ":";
+                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].RepeatData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+
+                               DataLine.clear();
+                               DataLineProcessed.clear();                              
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index 18ca4e4..b98907f 100644 (file)
@@ -136,6 +136,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "ACTION;FUNKY=SOUNDS:AUDIO\n"
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160220T160000Z\n"
        "DURATION;FLYING=NO:PT5H\n"
+       "REPEAT;NEVER=SLEEP:PT5M\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
@@ -143,6 +144,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "DURATION;FLYING=YES:PT7H\n"
        "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;TERRIBLE=TOKEN:This is the secon\n"
        " d alarm.\n"
+       "REPEAT;SLEEP=ALWAYS:PT3M\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:EMAIL\n"
@@ -152,6 +154,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "  alarm.\n"
        "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=en;MEEP=MOOP:This is the summary of the\n"
        "  third alarm.\n"
+       "REPEAT;SLEEP=ALWAYS:PT3M\n"
        "END:VALARM\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