Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added X-Token property for saving data from a CalendarTaskObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 7 Jun 2016 22:01:28 +0000 (23:01 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 7 Jun 2016 22:29:46 +0000 (23:29 +0100)
Added the code and unit tests for the X-Token property.

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

index 63b57fc..a619e99 100644 (file)
@@ -1585,6 +1585,29 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the X-Token values.
+       
+       if (XTokensData.size() > 0){
+                               
+               for (int XTokenSeek = 0; XTokenSeek < XTokensData.size();
+                       XTokenSeek++){
+       
+                       DataLine += XTokensDataTokens[XTokenSeek];              
+                       DataLine += ":";
+                       DataLine += XTokensData[XTokenSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+       
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                                       
+               }
+                               
+       }
+       
        *SaveData += "END:VTODO\n";
        
 }
\ No newline at end of file
index 64176e4..84e554a 100644 (file)
@@ -168,6 +168,15 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        "X-EXAMPLE2;NOPE=YEP:Example Data 2\n"
        "X-EXAMPLE3;WORLD=NO:Example Data 3\n"
        "END:VALARM\n"
+       "X-EXAMPLE1:Moo\n"
+       "X-EXAMPLE1;ANIMAL=NOPE:Meep\n"
+       "X-EXAMPLE1;ANIMAL=CAT:Meow\n"
+       "X-EXAMPLE2:Dish\n"
+       "X-EXAMPLE2;OBJECT=KITCHEN:Fork\n"
+       "X-EXAMPLE2;OBJECT=LIVINGROOM:Table\n"
+       "X-STATUS;HOLIDAY=YES:Idle\n"
+       "X-TRANSPORT;PUBLIC=NO:Private Hire\n"
+       "X-PHANTOM-STATUS;HELP=NONE:None\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