From: Steve Brokenshire Date: Mon, 6 Jun 2016 21:08:01 +0000 (+0100) Subject: Added LOCATION property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~165 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=d66064e1ae76697db87543ccad0a79a658578a51;p=xestiacalendar%2F.git Added LOCATION property for saving data from a CalendarTaskObject. Added the code and unit tests for the LOCATION property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 85f5692..4c49018 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -287,6 +287,47 @@ void CalendarTaskObject::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:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index 226fe41..fbe5341 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -67,6 +67,8 @@ TEST(iCalendarSaveTask, SaveTaskTests){ " 03000Z\n" "GEO;EXAMPLE=MOOP:20.0;20.0\n" "LAST-MODIFIED;FUTURE=EVEN:20160131T114200Z\n" + "LOCATION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXACT=YES:The Crystal Ceiling, Trur\n" + " o\n" "END:VTODO\n" "END:VCALENDAR";