From 79aa3e385905310fd092ad02a8e4d5c54200809d Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:35:45 +0100 Subject: [PATCH] Added RRULE property for saving data from a CalendarJournalObject. Added the code and unit tests for the RRULE property. --- .../calendarjournal/CalendarJournal-Save.cpp | 25 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 1 + 2 files changed, 26 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 8849a93..a5704e1 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -388,6 +388,31 @@ void CalendarJournalObject::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:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index 5e19324..18ff886 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -78,6 +78,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "SEQUENCE;TEST=YAY:7\n" "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" "URL;EXTERNAL=YES:http://www.example.com/\n" + "RRULE;TEST=DATA:FREQ=DAILY;COUNT=10\n" "END:VJOURNAL\n" "END:VCALENDAR"; -- 2.39.5