From 1612bf8fb1e85902444ad09a25a7acd3e94a1690 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:03:43 +0100 Subject: [PATCH] Added LAST-MODIFIED property for saving data from a CalendarTaskObject. Added the code and unit tests for the LAST-MODIFIED property. --- .../calendartask/CalendarTask-Save.cpp | 28 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 1 + 2 files changed, 29 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 7179960..85f5692 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -259,6 +259,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the LAST-MODIFIED value. + + if (LastModifiedData.size() > 0){ + + if (LastModifiedTokens.size() > 0){ + + DataLine += "LAST-MODIFIED;"; + DataLine += LastModifiedTokens; + + } else { + + DataLine += "LAST-MODIFIED"; + + } + + DataLine += ":"; + DataLine += LastModifiedData; + 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 04fd37b..226fe41 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -66,6 +66,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160131T1\n" " 03000Z\n" "GEO;EXAMPLE=MOOP:20.0;20.0\n" + "LAST-MODIFIED;FUTURE=EVEN:20160131T114200Z\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5