phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp
branchRCL_3
changeset 10 ba54057fe027
parent 0 5f000ab63145
child 12 b68fcd923911
equal deleted inserted replaced
9:91c2fb4b78df 10:ba54057fe027
    72     delete iSortOrder;
    72     delete iSortOrder;
    73     if( iContactManager )
    73     if( iContactManager )
    74         {
    74         {
    75         TRAP_IGNORE( iContactManager->ContactStoresL().CloseAll( *this ) );
    75         TRAP_IGNORE( iContactManager->ContactStoresL().CloseAll( *this ) );
    76         }
    76         }
       
    77     delete iContactStore;
    77     delete iContactManager;
    78     delete iContactManager;
    78     delete iContactStoreUris;
    79     delete iContactStoreUris;
    79     }
    80     }
    80 
    81 
    81 // ---------------------------------------------------------------------------
    82 // ---------------------------------------------------------------------------
   358 // Indication that contact stores has been opened.
   359 // Indication that contact stores has been opened.
   359 // ---------------------------------------------------------------------------
   360 // ---------------------------------------------------------------------------
   360 //
   361 //
   361 void CPhCntContactManager::OpenComplete()
   362 void CPhCntContactManager::OpenComplete()
   362     {
   363     {
       
   364     if ( iStoreLoaderObserver )
       
   365         {      
       
   366         iStoreLoaderObserver->ContactStoreLoadingCompleted(
       
   367            iContactStore, KErrNone );
       
   368         iStoreLoaderObserver = NULL;
       
   369         }
   363     }
   370     }
   364 
   371 
   365 // ---------------------------------------------------------------------------
   372 // ---------------------------------------------------------------------------
   366 // From MVPbkContactStoreListObserver
   373 // From MVPbkContactStoreListObserver
   367 // Indication that contact store has been opened.
   374 // Indication that contact store has been opened.
   368 // ---------------------------------------------------------------------------
   375 // ---------------------------------------------------------------------------
   369 //
   376 //
   370 void CPhCntContactManager::StoreReady(
   377 void CPhCntContactManager::StoreReady(
   371     MVPbkContactStore& aContactStore )
   378     MVPbkContactStore& aContactStore )
   372     {
   379     {
       
   380     
   373     TVPbkContactStoreUriPtr uri = aContactStore.StoreProperties().Uri();
   381     TVPbkContactStoreUriPtr uri = aContactStore.StoreProperties().Uri();
   374 
   382 
   375     if ( iStoreLoaderObserver
   383     if ( !iContactStoreUris->ContactStores().IsIncluded( uri ) )
   376             && !iContactStoreUris->ContactStores().IsIncluded( uri ) )
       
   377         {
   384         {
   378         TRAP_IGNORE( iContactStoreUris->AddContactStoreL( uri ) );
   385         TRAP_IGNORE( iContactStoreUris->AddContactStoreL( uri ) );
   379 
   386         }
   380         iStoreLoaderObserver->ContactStoreLoadingCompleted(
   387     
   381             &aContactStore, KErrNone );
   388     iContactStore = &aContactStore;
   382         iStoreLoaderObserver = NULL;
   389      
   383         }
       
   384     iContactStoreUris->StoreReady( uri );
   390     iContactStoreUris->StoreReady( uri );
   385     }
   391     }
   386 
   392 
   387 // ---------------------------------------------------------------------------
   393 // ---------------------------------------------------------------------------
   388 // From MVPbkContactStoreListObserver
   394 // From MVPbkContactStoreListObserver