calendarui/organizerplugin/aiagendapluginengine/src/AIAgendaPluginEngineImpl.cpp
branchRCL_3
changeset 13 1984aceb8774
parent 0 f979ecb2b13e
child 14 21239b3bcd78
equal deleted inserted replaced
11:0f07cd1b5772 13:1984aceb8774
    49 //
    49 //
    50 void CAIAgendaPluginEngineImpl::ConstructL(void)
    50 void CAIAgendaPluginEngineImpl::ConstructL(void)
    51 {
    51 {
    52     TRACE_ENTRY_POINT;
    52     TRACE_ENTRY_POINT;
    53     
    53     
    54     iSession.ConnectL();
       
    55 
       
    56     if( iObserverType == ECalendarObserver || iObserverType == ECalendarAndTodoObserver )
    54     if( iObserverType == ECalendarObserver || iObserverType == ECalendarAndTodoObserver )
    57     {
    55     {
    58         TCallBack environmentChangeCallBack( EnvironmentChangeCallBack, this );
    56         TCallBack environmentChangeCallBack( EnvironmentChangeCallBack, this );
    59 
    57 
    60         // Create a notifier for system time and locale changes and midnight crossover
    58         // Create a notifier for system time and locale changes and midnight crossover
   155     delete iCalendarEngine;  // Close() called in destructor
   153     delete iCalendarEngine;  // Close() called in destructor
   156 
   154 
   157     iInstanceArray.ResetAndDestroy();
   155     iInstanceArray.ResetAndDestroy();
   158     iInstanceArray.Close();
   156     iInstanceArray.Close();
   159 
   157 
   160     iSession.Close();
       
   161     
   158     
   162     TRACE_EXIT_POINT;
   159     TRACE_EXIT_POINT;
   163 }
   160 }
   164 
   161 
   165 // ---------------------------------------------------------
   162 // ---------------------------------------------------------
   180 
   177 
   181     switch( iDBState )
   178     switch( iDBState )
   182     {
   179     {
   183         case EDBOffline:
   180         case EDBOffline:
   184         {
   181         {
   185             iDBState = EDBInitializing;
   182             iDBState = EDBInitialized;
   186             iSession.Initialize( *this );
   183             StateMachine();
   187         }
   184          }
   188         break;
   185         break;
   189 
   186 
   190         case EDBInitialized:
   187         case EDBInitialized:
   191         {
   188         {
   192             OpenDataBase();
   189             OpenDataBase();
   554     iInstanceArray.ResetAndDestroy();
   551     iInstanceArray.ResetAndDestroy();
   555 
   552 
   556     delete iCalendarEngine;
   553     delete iCalendarEngine;
   557     iCalendarEngine = NULL;
   554     iCalendarEngine = NULL;
   558 
   555 
   559     iSession.Uninitialize();
       
   560     
   556     
   561     TRACE_EXIT_POINT;
   557     TRACE_EXIT_POINT;
   562 }
   558 }
   563 
   559 
   564 void CAIAgendaPluginEngineImpl::RemoveExpiredEntries(void)
   560 void CAIAgendaPluginEngineImpl::RemoveExpiredEntries(void)
   878     
   874     
   879     TRACE_EXIT_POINT;
   875     TRACE_EXIT_POINT;
   880 }
   876 }
   881 
   877 
   882 // ---------------------------------------------------------
   878 // ---------------------------------------------------------
   883 // CAIAgendaPluginEngineImpl::CalendarServerInitialized
       
   884 // ?implementation_description
       
   885 // (other items were commented in a header).
       
   886 // ---------------------------------------------------------
       
   887 //
       
   888 void CAIAgendaPluginEngineImpl::CalendarServerInitialized(void)
       
   889 {
       
   890     TRACE_ENTRY_POINT;
       
   891     
       
   892     iDBState = EDBInitialized;  // EDBInitializing -> EDBInitialized
       
   893     StateMachine();
       
   894     
       
   895     TRACE_EXIT_POINT;
       
   896 }
       
   897 
       
   898 // ---------------------------------------------------------
       
   899 // CAIAgendaPluginEngineImpl::EnvironmentChangeCallBack
   879 // CAIAgendaPluginEngineImpl::EnvironmentChangeCallBack
   900 // ?implementation_description
   880 // ?implementation_description
   901 // (other items were commented in a header).
   881 // (other items were commented in a header).
   902 // ---------------------------------------------------------
   882 // ---------------------------------------------------------
   903 //
   883 //