From: Steve Brokenshire Date: Mon, 6 Jun 2016 21:00:10 +0000 (+0100) Subject: Added GEO property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~167 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=1ae8005a58f142872c9c3a03848fb160df3d1741;p=xestiacalendar%2F.git Added GEO property for saving data from a CalendarTaskObject. Added the code and unit tests for the GEO property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 63838e4..7179960 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -231,6 +231,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the GEO value. + + if (GeographicData.size() > 0){ + + if (GeographicTokens.size() > 0){ + + DataLine += "GEO;"; + DataLine += GeographicTokens; + + } else { + + DataLine += "GEO"; + + } + + DataLine += ":"; + DataLine += GeographicData; + 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 48cbe12..04fd37b 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -65,6 +65,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ " is a description of the todo.\n" "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160131T1\n" " 03000Z\n" + "GEO;EXAMPLE=MOOP:20.0;20.0\n" "END:VTODO\n" "END:VCALENDAR";