contextengine/plugins/calendarplugin/src/CalendarContextPlugin.cpp
branchRCL_3
changeset 63 e538444823de
parent 57 2872ae438bf7
equal deleted inserted replaced
57:2872ae438bf7 63:e538444823de
    87 //
    87 //
    88 CCalendarContextPlugin::~CCalendarContextPlugin() // destruct
    88 CCalendarContextPlugin::~CCalendarContextPlugin() // destruct
    89 	{
    89 	{
    90 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- ENTER" );
    90 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- ENTER" );
    91 	delete iCalInstanceView;
    91 	delete iCalInstanceView;
    92 	iCalInstanceView = NULL;
       
    93 	delete iCalSession;
    92 	delete iCalSession;
    94 	iCalSession = NULL;
       
    95 	
    93 	
    96 	if( iInitTimer )
    94 	if( iInitTimer )
    97 	    {
    95 	    {
    98 	    iInitTimer->Cancel();
    96 	    iInitTimer->Cancel();
    99 	    delete iInitTimer;
    97 	    delete iInitTimer;
   100 	    iInitTimer = NULL;
       
   101 	    }
    98 	    }
   102 		
    99 		
   103 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- RETURN" );
   100 	WRITELOG( "CCalendarContextPlugin::~CCalendarContextPlugin -- RETURN" );
   104 	}
   101 	}
   105 
   102 
   367 			WRITELOG( "CCalendarContextPlugin::AddMetaDataL - Couldn't create relation object!" );
   364 			WRITELOG( "CCalendarContextPlugin::AddMetaDataL - Couldn't create relation object!" );
   368 			User::Leave( KErrBadHandle );
   365 			User::Leave( KErrBadHandle );
   369 			}
   366 			}
   370 
   367 
   371 		WRITELOG( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE" );
   368 		WRITELOG( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE" );
   372 #ifdef _DEBUG
       
   373 		TRAP( addError, iMdeSession->AddRelationL( *relationObject ) );
   369 		TRAP( addError, iMdeSession->AddRelationL( *relationObject ) );
   374 		if ( addError != KErrNone)
   370 		if ( addError != KErrNone)
   375 			{
   371 			{
   376 			WRITELOG1( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE error: %d", addError );
   372 			WRITELOG1( "CCalendarContextPlugin::AddMetaDataL - Add calendar relation to MDE error: %d", addError );
   377 			}
   373 			}
   378 #else
       
   379 		TRAP_IGNORE( iMdeSession->AddRelationL( *relationObject ) );	
       
   380 #endif
       
   381 
   374 
   382 		CleanupStack::PopAndDestroy( relationObject );
   375 		CleanupStack::PopAndDestroy( relationObject );
   383 		CleanupStack::PopAndDestroy( calendarObject );
   376 		CleanupStack::PopAndDestroy( calendarObject );
   384 		}
   377 		}
   385 
   378 
   521 
   514 
   522 
   515 
   523 void CCalendarContextPlugin::StartRetryL()
   516 void CCalendarContextPlugin::StartRetryL()
   524     {
   517     {
   525     WRITELOG( "CCalendarContextPlugin::StartRetryL() ENTER" );
   518     WRITELOG( "CCalendarContextPlugin::StartRetryL() ENTER" );
       
   519     TInt err(KErrNone);
   526     
   520     
   527     if(iRetryCount++ > KMaxRetryCount)
   521     if(iRetryCount++ > KMaxRetryCount)
   528         {
   522         {
   529         delete iCalInstanceView;
   523         delete iCalInstanceView;
   530         iCalInstanceView = NULL;
   524         iCalInstanceView = NULL;
   539             }
   533             }
   540         
   534         
   541 		return; 
   535 		return; 
   542         }
   536         }
   543     
   537     
   544 #ifdef _DEBUG
   538     
   545     TInt err( KErrNone );
       
   546     if(!iInitTimer)
   539     if(!iInitTimer)
   547         {
   540         {
   548         TRAP(err, iInitTimer = CPeriodic::NewL( CActive::EPriorityStandard ) );
   541         TRAP(err, iInitTimer = CPeriodic::NewL(CActive::EPriorityStandard) );
   549         }
   542         }
   550                 
   543                 
   551     if( err != KErrNone )
   544     if( err != KErrNone )
   552         {
   545         {
   553         WRITELOG1( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start failed %d", err );
   546         WRITELOG1( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start failed %d", err );
   554         User::Leave( err );
   547         User::Leave( err );
   555         }
   548         }
   556 #else
   549         
   557     if(!iInitTimer)
       
   558         {
       
   559         iInitTimer = CPeriodic::NewL( CActive::EPriorityStandard );
       
   560         }    
       
   561 #endif
       
   562     
       
   563     WRITELOG( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start" );
   550     WRITELOG( "CCalendarContextPlugin::OpenViewL() iInitTimer->Start" );
   564     iInitTimer->Start( KInitRetryTimeout, KInitRetryTimeout, TCallBack(InitRetryCallback, this));
   551     iInitTimer->Start( KInitRetryTimeout, KInitRetryTimeout, TCallBack(InitRetryCallback, this));
   565     WRITELOG( "CCalendarContextPlugin::StartRetryL() RETURN" );
   552     WRITELOG( "CCalendarContextPlugin::StartRetryL() RETURN" );
   566     }
   553     }
   567 	
   554