From: Steve Brokenshire Date: Sun, 5 Jun 2016 21:54:03 +0000 (+0100) Subject: Added SUMMARY property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~196 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=ead23660569625b5c84ce4bc7d98ca4e30aa897f;p=xestiacalendar%2F.git Added SUMMARY property for saving data from a CalendarJournalObject. Added the code and unit tests for the SUMMARY property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 7235419..12578b7 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -65,6 +65,47 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the SUMMARY. + + if (SummaryData.size() > 0){ + + DataLine += "SUMMARY"; + + if (SummaryDataAltRep.size() > 0){ + + DataLine += ";ALTREP=\""; + DataLine += SummaryDataAltRep; + DataLine += "\""; + + } + + if (SummaryDataLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += SummaryDataLanguage; + + } + + if (SummaryDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += SummaryDataTokens; + + } + + DataLine += ":"; + DataLine += SummaryData; + 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 eb2263b..9561f55 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -39,6 +39,9 @@ TEST(iCalendarSaveJournal, SaveEventTests){ "BEGIN:VJOURNAL\n" "UID:329128-12939123-123123-13\n" "DTSTAMP:20160116T190200Z\n" + "SUMMARY:Unit Test Event 1 which has to be a really long summary as we don't k\n" + " now if multiple line processing is going to work without it. I mean seriousl\n" + " y, how annoying can this potentially be?\n" "END:VJOURNAL\n" "END:VCALENDAR";