From eb8a7ebe5c3ef376611212ec485a9e78574e0cf7 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:38:08 +0100 Subject: [PATCH] Added STATUS property for saving data from a CalendarTaskObject. Added the code and unit tests for the STATUS property. --- .../calendartask/CalendarTask-Save.cpp | 33 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 1 + 2 files changed, 34 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 1b7ad70..278da51 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -511,6 +511,39 @@ void CalendarTaskObject::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:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index 482e107..c641dc4 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -76,6 +76,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "RECURRENCE-ID;TZID=Europe/Truro;RANGE=THISANDFUTURE;VALUE=DATE;EXAMPLE=DATA:2\n" " 0160131\n" "SEQUENCE;TEST=YAY:3\n" + "STATUS;LANGUAGE=kw;FAVOURITE=BEANS;NOTLIKE=UNKNOWN:2.0;Success\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5