phonebookengines/VirtualPhonebook/VPbkCntModel/src/CContactStore.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 23 5586b4d2ec3e
child 64 c1e8ba0c2b16
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
   782 void CContactStore::ContactDestroyed(CContactItem* aContactItem, TBool aCloseContact )
   782 void CContactStore::ContactDestroyed(CContactItem* aContactItem, TBool aCloseContact )
   783     {
   783     {
   784     // Release any lock on contact.
   784     // Release any lock on contact.
   785     if (aContactItem)
   785     if (aContactItem)
   786         {
   786         {
   787         // Check that contact store is open
       
   788         __ASSERT_DEBUG( iContactDb,
       
   789             ContactStorePanic( EPreCond_ContactDestroyed ) );
       
   790 
       
   791         // Cancel async operation if any
   787         // Cancel async operation if any
   792         iAsyncContactOperation->Cancel( aContactItem );
   788         iAsyncContactOperation->Cancel( aContactItem );
   793 
   789 
   794         if ( aCloseContact )
   790         //iContactDb may be already null if store configuration changed by
       
   791         //removing the current store from store configuartion
       
   792         if ( aCloseContact && iContactDb)
   795         	{
   793         	{
   796 	        // CloseContactL doesn't leave despite its name.
   794 	        // CloseContactL doesn't leave despite its name.
   797 	        iContactDb->CloseContactL(aContactItem->Id());
   795 	        iContactDb->CloseContactL(aContactItem->Id());
   798         	}
   796         	}
   799         }
   797         }
   915         iFieldFactory = NULL;
   913         iFieldFactory = NULL;
   916         delete iDbNotifier;
   914         delete iDbNotifier;
   917         iDbNotifier = NULL;
   915         iDbNotifier = NULL;
   918         delete iContactDb;
   916         delete iContactDb;
   919         iContactDb = NULL;
   917         iContactDb = NULL;
       
   918         // Set iGroupsFetched to false.
       
   919         // Make sure iGroupIds is updated again after store is opened again.
       
   920         iStoreInfo->ResetGroupsFetched();
   920         }
   921         }
   921     }
   922     }
   922 
   923 
   923 // --------------------------------------------------------------------------
   924 // --------------------------------------------------------------------------
   924 // CContactStore::CreateNewContactLC
   925 // CContactStore::CreateNewContactLC