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

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

index a5afcd5..8f28931 100644 (file)
@@ -340,6 +340,47 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the LOCATION value.
+
+       if (LocationData.size() > 0){
+               
+               DataLine += "LOCATION";
+               
+               if (LocationDataAltRep.size() > 0){
+               
+                       DataLine += ";ALTREP=\"";
+                       DataLine += LocationDataAltRep;
+                       DataLine += "\"";
+                       
+               }
+               
+               if (LocationDataLanguage.size() > 0){
+               
+                       DataLine += ";LANGUAGE=";
+                       DataLine += LocationDataLanguage;                       
+                       
+               }
+               
+               if (LocationDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += LocationDataTokens;
+                       
+               }
+               
+               DataLine += ":";
+               DataLine += LocationData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index dcb07be..b6c7576 100644 (file)
@@ -84,6 +84,7 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        " is a description of the event.\n"
        "GEO;EXAMPLE=MEEP:5.0;5.0\n"
        "LAST-MODIFIED;FUTURE=ODD:20160124T093000Z\n"
+       "LOCATION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXACT=NO:The Basement, Truro\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