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

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

index 4dbbebe..69dc773 100644 (file)
@@ -1185,7 +1185,47 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
 
                        DataLine.clear();
                        DataLineProcessed.clear();
+                       
+                       // Process the TRIGGER VALARM value.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].TriggerData.size() > 0){
+                               
+                               DataLine += "TRIGGER";
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].TriggerRelated.size() > 0){
+               
+                                       DataLine += ";RELATED=";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].TriggerRelated;
+                       
+                               }
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].TriggerValue.size() > 0){
+               
+                                       DataLine += ";VALUE=";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].TriggerValue;
+                       
+                               }
                                
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].TriggerTokens.size() > 0){
+               
+                                       DataLine += ";";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].TriggerTokens;
+                       
+                               }
+                               
+                               DataLine += ":";
+                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].TriggerData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+
+                               DataLine.clear();
+                               DataLineProcessed.clear();                              
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index 66b5c60..b365394 100644 (file)
@@ -134,12 +134,15 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "RDATE;ZILCH=DATA:20160520\n"
        "BEGIN:VALARM\n"
        "ACTION;FUNKY=SOUNDS:AUDIO\n"
+       "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160220T160000Z\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
+       "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160230T110000Z\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:EMAIL\n"
+       "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160230T120000Z\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