javaextensions/pim/versit/src.s60/cpimcalendarconverter.cpp
changeset 23 98ccebc37403
parent 21 2a9601315dfc
child 67 63b81d807542
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
    28 #include "cpimtodoitem.h"
    28 #include "cpimtodoitem.h"
    29 #include "cpimtodopropertyconverter.h"
    29 #include "cpimtodopropertyconverter.h"
    30 #include "cpimeventpropertyconverter.h"
    30 #include "cpimeventpropertyconverter.h"
    31 #include "fs_methodcall.h"
    31 #include "fs_methodcall.h"
    32 #include "logger.h"
    32 #include "logger.h"
    33 #include "cleanupresetanddestroy.h"
    33 #include "javasymbianoslayer.h"
    34 
    34 
    35 // EXTERNAL INCLUDES
    35 // EXTERNAL INCLUDES
    36 #include <vcal.h>
    36 #include <vcal.h>
    37 
    37 
    38 // ============================ MEMBER FUNCTIONS ===============================
    38 // ============================ MEMBER FUNCTIONS ===============================
   240 //
   240 //
   241 void CPIMCalendarConverter::ParserToEventL(CParserVCalEntity& aParser,
   241 void CPIMCalendarConverter::ParserToEventL(CParserVCalEntity& aParser,
   242         RPointerArray<CPIMItem>& aItemArray)
   242         RPointerArray<CPIMItem>& aItemArray)
   243 {
   243 {
   244     JELOG2(EPim);
   244     JELOG2(EPim);
   245     CleanupResetAndDestroyPushL(aItemArray);
   245    
   246     CPIMEventItem* item = CPIMEventItem::NewLC(iEventValidator);
   246     CPIMEventItem* item = CPIMEventItem::NewLC(iEventValidator);
   247     TPIMDate alarm(TInt64(0));
   247     TPIMDate alarm(TInt64(0));
   248     // We don't take the ownership of the propertyArray, so the properties
   248     // We don't take the ownership of the propertyArray, so the properties
   249     // are deleted when the parser is
   249     // are deleted when the parser is
   250     CArrayPtr<CParserProperty>* propertyArray = aParser.ArrayOfProperties(
   250     CArrayPtr<CParserProperty>* propertyArray = aParser.ArrayOfProperties(
   267             TTimeIntervalSeconds interval(0);
   267             TTimeIntervalSeconds interval(0);
   268             User::LeaveIfError(startDate.SecondsFrom(alarm, interval));
   268             User::LeaveIfError(startDate.SecondsFrom(alarm, interval));
   269             item->addInt(EPIMEventAlarm, KPIMAttrNone, interval.Int());
   269             item->addInt(EPIMEventAlarm, KPIMAttrNone, interval.Int());
   270         }
   270         }
   271     }
   271     }
       
   272 	CleanupClosePushL(aItemArray);
   272     User::LeaveIfError(aItemArray.Append(item));
   273     User::LeaveIfError(aItemArray.Append(item));
   273     CleanupStack::Pop(item); // item
   274     CleanupStack::Pop(item); // item
   274     CleanupStack::Pop(&aItemArray);
   275     CleanupStack::Pop(&aItemArray);
   275 }
   276 }
   276 
   277 
   281 //
   282 //
   282 void CPIMCalendarConverter::ParserToToDoL(CParserVCalEntity& aParser,
   283 void CPIMCalendarConverter::ParserToToDoL(CParserVCalEntity& aParser,
   283         RPointerArray<CPIMItem>& aItemArray)
   284         RPointerArray<CPIMItem>& aItemArray)
   284 {
   285 {
   285     JELOG2(EPim);
   286     JELOG2(EPim);
   286     CleanupResetAndDestroyPushL(aItemArray);
   287     
   287     CPIMToDoItem* item = CPIMToDoItem::NewLC(iToDoValidator);
   288     CPIMToDoItem* item = CPIMToDoItem::NewLC(iToDoValidator);
   288     TPIMDate alarm(TInt64(0));
   289     TPIMDate alarm(TInt64(0));
   289     // We don't take the ownership of the propertyArray, so the properties
   290     // We don't take the ownership of the propertyArray, so the properties
   290     // are deleted when the parser is
   291     // are deleted when the parser is
   291     CArrayPtr<CParserProperty>* propertyArray = aParser.ArrayOfProperties(
   292     CArrayPtr<CParserProperty>* propertyArray = aParser.ArrayOfProperties(
   316     }
   317     }
   317     else
   318     else
   318     {
   319     {
   319         item->AddBooleanL(EPIMToDoCompleted, KPIMAttrNone, ETrue);
   320         item->AddBooleanL(EPIMToDoCompleted, KPIMAttrNone, ETrue);
   320     }
   321     }
       
   322     CleanupClosePushL(aItemArray);
   321     User::LeaveIfError(aItemArray.Append(item));
   323     User::LeaveIfError(aItemArray.Append(item));
   322     CleanupStack::Pop(item); // item
   324     CleanupStack::Pop(item); // item
   323     CleanupStack::Pop(&aItemArray);
   325     CleanupStack::Pop(&aItemArray);
   324 }
   326 }
   325 
   327