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

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

index 1708aa4..2b34da7 100644 (file)
@@ -843,6 +843,44 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                        
        }
        
+       // Process the CATEGORIES value.
+       
+       if (CategoriesList.size() > 0){
+               
+               for (int CategoriesListSeek = 0; CategoriesListSeek < CategoriesList.size();
+                       CategoriesListSeek++){
+       
+                       DataLine += "CATEGORIES";
+                               
+                       if (CategoriesListLanguage[CategoriesListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += CategoriesListLanguage[CategoriesListSeek];
+                       
+                       }                       
+                       
+                       if (CategoriesListTokens[CategoriesListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += CategoriesListTokens[CategoriesListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += CategoriesList[CategoriesListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VTODO\n";
        
 }
\ No newline at end of file
index 49753a4..fc4d311 100644 (file)
@@ -93,6 +93,10 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        "ATTENDEE;DIR=\"null:nodata\";SENT-BY=\"mailto:sent.by@example.com\";CN=\"Attendee \n"
        " The Third\";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;LANGUAGE=kw;EXAMPLE=DATA:Atte\n"
        " ndee Three\n"
+       "CATEGORIES:CATEGORY ONE, CATEGORY TWO\n"
+       "CATEGORIES;LANGUAGE=en:CATEGORY THREE, CATEGORY FOUR\n"
+       "CATEGORIES;LANGUAGE=en-GB;SAMPLE=TOKEN:CATEGORY FIVE, CATEGORY SIX, CATEGORY \n"
+       " SEVEN\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