From: Steve Brokenshire Date: Thu, 9 Jun 2016 22:32:48 +0000 (+0100) Subject: Added TZURL property for saving data from a CalendarTimezoneObject. X-Git-Tag: release-0.02~135 X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=commitdiff_plain;h=770055c33dbbc150d15f52c232b90ec2317dc639 Added TZURL property for saving data from a CalendarTimezoneObject. Added the code and unit tests for the TZURL property. --- diff --git a/source/objects/calendartimezone/CalendarTimezone-Save.cpp b/source/objects/calendartimezone/CalendarTimezone-Save.cpp index 8858e15..c52c70e 100644 --- a/source/objects/calendartimezone/CalendarTimezone-Save.cpp +++ b/source/objects/calendartimezone/CalendarTimezone-Save.cpp @@ -65,6 +65,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){ } + // Process the TZURL value. + + if (TimeZoneURLData.size() > 0){ + + if (TimeZoneURLTokens.size() > 0){ + + DataLine += "TZURL;"; + DataLine += TimeZoneURLTokens; + + } else { + + DataLine += "TZURL"; + + } + + DataLine += ":"; + DataLine += TimeZoneURLData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VTIMEZONE\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltimezonesave.h b/source/tests/xestiacalendar_icaltimezonesave.h index eff6583..ff6c101 100644 --- a/source/tests/xestiacalendar_icaltimezonesave.h +++ b/source/tests/xestiacalendar_icaltimezonesave.h @@ -63,6 +63,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){ "BEGIN:VTIMEZONE\n" "TZID;OTHER=PARAM:Example/Starrgazy\n" "LAST-MODIFIED;FUTURE=ODD:20160203T200700Z\n" + "TZURL;URL=YES:http://www.example.com/\n" "END:VTIMEZONE\n" "END:VCALENDAR";