From ee34a74f978b302e82402380515fd16e564d9389 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:48:15 +0100 Subject: [PATCH] Added URL property for saving data from a CalendarTaskObject. Added the code and unit tests for the URL property. --- .../calendartask/CalendarTask-Save.cpp | 26 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 1 + 2 files changed, 27 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 935ead5..5563801 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -585,6 +585,32 @@ void CalendarTaskObject::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:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index f73e027..d267c46 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -79,6 +79,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "STATUS;LANGUAGE=kw;FAVOURITE=BEANS;NOTLIKE=UNKNOWN:2.0;Success\n" "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=kw;FAVOURITE=TOFU;NOTLIKE=NONE:A summar\n" " y of the todo.\n" + "URL;EXTERNAL=YES:http://www.example.com/\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5