serviceproviders/sapi_contacts_vpbk/tsrc/testing/tcontact_add/src/tcontact_addblocks.cpp
branchRCL_3
changeset 45 a9c0808a1095
parent 44 0b68a1b0c15e
equal deleted inserted replaced
44:0b68a1b0c15e 45:a9c0808a1095
   156      TPtrC8 fieldKey(KNullDesC8);
   156      TPtrC8 fieldKey(KNullDesC8);
   157          TPtrC  label(KNullDesC); 
   157          TPtrC  label(KNullDesC); 
   158          TPtrC  value(KNullDesC);       
   158          TPtrC  value(KNullDesC);       
   159      //CContactCallback* callbk=new(ELeave) CContactCallback;
   159      //CContactCallback* callbk=new(ELeave) CContactCallback;
   160      TPtr8 cntIdPtrVal(acntId->Des());
   160      TPtr8 cntIdPtrVal(acntId->Des());
   161      CContactIter* iterVal;
   161      CContactIter* iterVal = NULL;
   162      TRAPD(err, iterVal = cntservice->GetListL(EContacts,cntIdPtrVal));
   162      TRAPD(err, iterVal = cntservice->GetListL(EContacts,cntIdPtrVal));
   163      if(err != KErrNone)
   163      if(err != KErrNone)
   164          {
   164          {
   165 		  /*file.Write(_L8("\n err code of getlist is non zero"));	
   165 		  /*file.Write(_L8("\n err code of getlist is non zero"));	
   166 		file.Flush(); */
   166 		file.Flush(); */
   965     singleContact->AddFieldToContactL(singleContactField);
   965     singleContact->AddFieldToContactL(singleContactField);
   966    
   966    
   967    aItem.GetNextInt(count) ;
   967    aItem.GetNextInt(count) ;
   968    
   968    
   969    /*Add group1 to phonebook */
   969    /*Add group1 to phonebook */
   970    TInt err1;
   970    TInt err1 = 0;
   971    TRAPD(err,icontactservice->AddL(icallback,0,singleContact,KNullDesC8,KGroup));
   971    TRAPD(err,icontactservice->AddL(icallback,0,singleContact,KNullDesC8,KGroup));
   972    if(err || err1)
   972    if(err || err1)
   973    {
   973    {
   974 CleanupStack::Pop(singleContactField);
   974 CleanupStack::Pop(singleContactField);
   975 CleanupStack::Pop(singleContact);
   975 CleanupStack::Pop(singleContact);
  1359     
  1359     
  1360     aItem.GetNextInt(count) ;
  1360     aItem.GetNextInt(count) ;
  1361 
  1361 
  1362 	icontactservice=CContactService::NewL();
  1362 	icontactservice=CContactService::NewL();
  1363     /* Add the contactitem */
  1363     /* Add the contactitem */
  1364     HBufC8* cntId;
  1364     HBufC8* cntId = NULL;
  1365     TRAPD(error,cntId= icontactservice->AddL(singleContact));
  1365     TRAPD(error,cntId= icontactservice->AddL(singleContact));
  1366 	   
  1366 	   
  1367     
  1367     
  1368      if(error == KErrNone)
  1368      if(error == KErrNone)
  1369          {
  1369          {
  1439   _LIT( KExample, "In GetList_Test17L" );
  1439   _LIT( KExample, "In GetList_Test17L" );
  1440   TestModuleIf().Printf( 0, Ktsapicontacts, KExample );
  1440   TestModuleIf().Printf( 0, Ktsapicontacts, KExample );
  1441   // Print to log file
  1441   // Print to log file
  1442   iLog->Log( KExample );
  1442   iLog->Log( KExample );
  1443   
  1443   
  1444   HBufC8* grpId;
  1444   HBufC8* grpId = NULL;
  1445   TInt count;
  1445   TInt count;
  1446  
  1446  
  1447  /* Group1 to add to phonebook */      
  1447  /* Group1 to add to phonebook */      
  1448  _LIT(KGroup,"Group17")  ;
  1448  _LIT(KGroup,"Group17")  ;
  1449  
  1449