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

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

index 69dc773..03c6687 100644 (file)
@@ -1226,6 +1226,32 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                                
                        }
                        
+                       // Process the DURATION VALARM value.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].DurationData.size() > 0){
+                               
+                               DataLine += "DURATION";
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].DurationTokens.size() > 0){
+               
+                                       DataLine += ";";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DurationTokens;
+                       
+                               }
+                               
+                               DataLine += ":";
+                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DurationData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+
+                               DataLine.clear();
+                               DataLineProcessed.clear();                              
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index b365394..fa03963 100644 (file)
@@ -135,14 +135,17 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "BEGIN:VALARM\n"
        "ACTION;FUNKY=SOUNDS:AUDIO\n"
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160220T160000Z\n"
+       "DURATION;FLYING=NO:PT5H\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160230T110000Z\n"
+       "DURATION;FLYING=YES:PT7H\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:EMAIL\n"
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160230T120000Z\n"
+       "DURATION;FLYING=YES:PT7H\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