From: Steve Brokenshire Date: Mon, 6 Jun 2016 20:46:31 +0000 (+0100) Subject: Added CREATED property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~170 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=0f13877552ebdd42a0da748f60f9c23e7b1c63fa;p=xestiacalendar%2F.git Added CREATED property for saving data from a CalendarTaskObject. Added the code and unit tests for the CREATED property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 222e9a4..80d02fc 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -120,6 +120,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ DataLineProcessed.clear(); } + + // Process the CREATED value. + + if (DateTimeCreatedData.size() > 0){ + + if (DateTimeCreatedTokens.size() > 0){ + + DataLine += "CREATED;"; + DataLine += DateTimeCreatedTokens; + + } else { + + DataLine += "CREATED"; + + } + + DataLine += ":"; + DataLine += DateTimeCreatedData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } *SaveData += "END:VTODO\n"; diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index 5e10bec..af26f79 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -60,6 +60,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "DTSTAMP;OTHER=PARAM:20160131T104500Z\n" "CLASS;CHOCOLATE=NONE:PUBLIC\n" "COMPLETED;LYING=NEVER:20160131T110100Z\n" + "CREATED;CARAMEL=PLEASE:20160131T080000Z\n" "END:VTODO\n" "END:VCALENDAR";