Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added PERCENT-COMPLETE property for saving data from a CalendarTaskObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 21:31:55 +0000 (22:31 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 21:31:55 +0000 (22:31 +0100)
Added the code and unit tests for the PERCENT-COMPLETE property.

source/objects/calendartask/CalendarTask-Save.cpp
source/tests/xestiacalendar_icaltasksave.h

index 9498b85..c3b4f17 100644 (file)
@@ -384,6 +384,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the PERCENT-COMPLETE value.
+       
+       if (PercentCompleteData.size() > 0){
+               
+               if (PercentCompleteTokens.size() > 0){
+               
+                       DataLine += "PERCENT-COMPLETE;";
+                       DataLine += PercentCompleteTokens;
+                       
+               } else {
+
+                       DataLine += "PERCENT-COMPLETE";
+                       
+               }
+
+               DataLine += ":";
+               DataLine += PercentCompleteData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VTODO\n";
        
 }
\ No newline at end of file
index 76c359e..45a8cda 100644 (file)
@@ -71,6 +71,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        " o\n"
        "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n"
        " eply@example.com\";LANGUAGE=kw;HAPPY=WEEKS:mailto:organiser@example.com\n"
+       "PERCENT-COMPLETE;DEEP=THOUGHT:42\n"
        "END:VTODO\n"
        "END:VCALENDAR";
        
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy