From d43452a2e3f8b6b816429061e380c7ed1e5481b6 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jun 2016 23:30:09 +0100 Subject: [PATCH] Added URL property for saving data from a CalendarJournalObject. Added the code and unit tests for the URL property. --- .../calendarjournal/CalendarJournal-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaljournalsave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 0c18ae0..8849a93 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -362,6 +362,32 @@ void CalendarJournalObject::SaveObjectData(string *SaveData){ } + // Process the URL value. + + if (URLData.size() > 0){ + + DataLine += "URL"; + + if (URLDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += URLDataTokens; + + } + + DataLine += ":"; + DataLine += URLData; + 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 6906295..5e19324 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -77,6 +77,7 @@ TEST(iCalendarSaveJournal, SaveEventTests){ " 0160131\n" "SEQUENCE;TEST=YAY:7\n" "STATUS;LANGUAGE=kw;FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN:2.0;Success\n" + "URL;EXTERNAL=YES:http://www.example.com/\n" "END:VJOURNAL\n" "END:VCALENDAR"; -- 2.39.5