From 9cb65a851b528f76ad6b075da24f4917cd2539c5 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:36:18 +0100 Subject: [PATCH] Added SEQUENCE property for saving data from a CalendarTaskObject. Added the code and unit tests for the SEQUENCE property. --- .../calendartask/CalendarTask-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 410fc56..1b7ad70 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -485,6 +485,32 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the SEQUENCE value. + + if (SequenceData > -1 && SequenceData < 10){ + + DataLine += "SEQUENCE"; + + if (SequenceTokens.size() > 0){ + + DataLine += ";"; + DataLine += SequenceTokens; + + } + + DataLine += ":"; + DataLine += to_string(SequenceData); + 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 aa3b88b..482e107 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -75,6 +75,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "PRIORITY;STATUS=DEFAULT:5\n" "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" + "SEQUENCE;TEST=YAY:3\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5