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

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

index 03c6687..53ba9d1 100644 (file)
@@ -1252,6 +1252,47 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                                
                        }
                        
+                       // Process the DESCRIPTION VALARM value.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].DescriptionData.size() > 0){
+                               
+                               DataLine += "DESCRIPTION";
+
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].DescriptionAltRep.size() > 0){
+               
+                                       DataLine += ";ALTREP=\"";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DescriptionAltRep;
+                                       DataLine += "\"";
+                       
+                               }
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].DescriptionLanguage.size() > 0){
+               
+                                       DataLine += ";LANGUAGE=";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DescriptionLanguage;
+                       
+                               }
+                               
+                               if (CalendarAlarmData[CalendarAlarmDataSeek].DescriptionTokens.size() > 0){
+               
+                                       DataLine += ";";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DescriptionTokens;
+                       
+                               }
+                               
+                               DataLine += ":";
+                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].DescriptionData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+
+                               DataLine.clear();
+                               DataLineProcessed.clear();                              
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index fa03963..199487c 100644 (file)
@@ -141,11 +141,15 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160230T110000Z\n"
        "DURATION;FLYING=YES:PT7H\n"
+       "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;TERRIBLE=TOKEN:This is the secon\n"
+       " d alarm.\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"
+       "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;TERRIBLE=TOKEN:This is the third\n"
+       "  alarm.\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