From: Steve Brokenshire Date: Mon, 6 Jun 2016 20:42:44 +0000 (+0100) Subject: Added COMPLETED property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~171 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=f791b31da6053df8294cca777f5eb4e7ec298c6c;p=xestiacalendar%2F.git Added COMPLETED property for saving data from a CalendarTaskObject. Added the code and unit tests for the COMPLETED property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 5e64ecc..222e9a4 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -93,6 +93,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the COMPLETED value. + + if (CompletedData.size() > 0){ + + if (CompletedDataTokens.size() > 0){ + + DataLine += "COMPLETED;"; + DataLine += CompletedDataTokens; + + } else { + + DataLine += "COMPLETED"; + + } + + DataLine += ":"; + DataLine += CompletedData; + 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 8ea88e4..5e10bec 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -59,6 +59,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "UID;UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT:b3a16392-ad86-4061-be53-c215af2306e1\n" "DTSTAMP;OTHER=PARAM:20160131T104500Z\n" "CLASS;CHOCOLATE=NONE:PUBLIC\n" + "COMPLETED;LYING=NEVER:20160131T110100Z\n" "END:VTODO\n" "END:VCALENDAR";