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

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

index 5236e1f..4dbbebe 100644 (file)
@@ -1155,6 +1155,43 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the VALARMS.
+       
+       if (CalendarAlarmData.size() > 0){
+               
+               for (int CalendarAlarmDataSeek = 0; CalendarAlarmDataSeek < CalendarAlarmData.size();
+                       CalendarAlarmDataSeek++){
+                       
+                       *SaveData += "BEGIN:VALARM\n";
+                       
+                       // Process the ACTION VALARM value.
+                               
+                       DataLine += "ACTION";
+
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].AlarmActionTokens.size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AlarmActionTokens;
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AlarmAction;
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+                       *SaveData += "END:VALARM\n";
+                       
+               }
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 61ca2d1..66b5c60 100644 (file)
@@ -132,6 +132,15 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "RDATE:20160120\n"
        "RDATE;VALUE=DATE;TZID=Europe/Truro:20160121\n"
        "RDATE;ZILCH=DATA:20160520\n"
+       "BEGIN:VALARM\n"
+       "ACTION;FUNKY=SOUNDS:AUDIO\n"
+       "END:VALARM\n"
+       "BEGIN:VALARM\n"
+       "ACTION;FLASHING=LIGHTS:DISPLAY\n"
+       "END:VALARM\n"
+       "BEGIN:VALARM\n"
+       "ACTION;FLASHING=LIGHTS:EMAIL\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