From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:30:09 +0000 (+0100) Subject: Added URL property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~188 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=d43452a2e3f8b6b816429061e380c7ed1e5481b6;p=xestiacalendar%2F.git Added URL property for saving data from a CalendarJournalObject. Added the code and unit tests for the URL property. --- 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";