From a0ac81a2ddd77c6d1beba95228a34ce85b8a644d Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:49:40 +0100 Subject: [PATCH] Added RRULE property for saving data from a CalendarTaskObject. Added the code and unit tests for the RRULE 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 5563801..d311cd3 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -611,6 +611,32 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the RRULE value. + + if (RecurranceRuleData.size() > 0){ + + DataLine += "RRULE"; + + if (RecurranceRuleDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += RecurranceRuleDataTokens; + + } + + DataLine += ":"; + DataLine += RecurranceRuleData; + 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 d267c46..0b6eba2 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -80,6 +80,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=kw;FAVOURITE=TOFU;NOTLIKE=NONE:A summar\n" " y of the todo.\n" "URL;EXTERNAL=YES:http://www.example.com/\n" + "RRULE;TEST=DATA:FREQ=DAILY;COUNT=10\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5