From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:28:18 +0000 (+0100) Subject: Added STATUS property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~189 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=e0319715f40f4306e03fb1b29e6fd95f365407cb;p=xestiacalendar%2F.git Added STATUS property for saving data from a CalendarJournalObject. Added the code and unit tests for the STATUS property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 44924cc..0c18ae0 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -329,6 +329,39 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the STATUS value. + + if (StatusData.size() > 0){ + + DataLine += "STATUS"; + + if (StatusLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += StatusLanguage; + + } + + if (StatusTokens.size() > 0){ + + DataLine += ";"; + DataLine += StatusTokens; + + } + + DataLine += ":"; + DataLine += StatusData; + 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 13f149b..6906295 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -76,6 +76,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" "SEQUENCE;TEST=YAY:7\n" + "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" "END:VJOURNAL\n" "END:VCALENDAR";