dbcreator/commsdatcreator/Src/cdcprocessordn.cpp
branchRCL_3
changeset 54 984e13af52c4
parent 0 5a93021fdf25
child 57 05bc53fe583b
equal deleted inserted replaced
45:4c83dcfb6f1a 54:984e13af52c4
   143                     User::Leave(err);    
   143                     User::Leave(err);    
   144                     }
   144                     }
   145                 break;
   145                 break;
   146                 }
   146                 }
   147             }
   147             }
   148         if (dnId == -1)
   148         CreateDestination(dnId);
   149             {
       
   150             iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName );        
       
   151             CLOG_WRITE( "Destinaton created without dnId.");
       
   152             }
       
   153         else
       
   154             {
       
   155             iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName, dnId);        
       
   156             CLOG_WRITE_FORMAT( "Destinaton created. dnId:%d", dnId);
       
   157             }
       
   158         }
   149         }
   159         
   150         
   160     HBufC *destName( NULL );
   151     HBufC *destName( NULL );
   161     TInt priority = 0;
   152     TInt priority = 0;
   162     RPointerArray<HBufC> names;
   153     RPointerArray<HBufC> names;
   466     CLOG_WRITE( "\t \r\n" )
   457     CLOG_WRITE( "\t \r\n" )
   467 
   458 
   468     CleanupStack::PopAndDestroy( tmp ); // Removes tmp.
   459     CleanupStack::PopAndDestroy( tmp ); // Removes tmp.
   469     }
   460     }
   470 
   461 
       
   462 // ---------------------------------------------------------
       
   463 // CProcessorDN::CreateDestination
       
   464 // ---------------------------------------------------------
       
   465 //
       
   466 void CProcessorDN::CreateDestination(TInt aDnId)
       
   467     {
       
   468     if (aDnId == -1)
       
   469         {
       
   470         iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName );        
       
   471         CLOG_WRITE( "Destinaton created without dnId.");
       
   472         }
       
   473     else
       
   474         {
       
   475         TRAPD( err, iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName, aDnId ) );
       
   476         switch ( err )
       
   477             {
       
   478             case KErrNone:
       
   479                 CLOG_WRITE_FORMAT( "Destination created. dnId:%d", aDnId);
       
   480                 break;
       
   481             case KErrAlreadyExists:
       
   482                 CLOG_WRITE_FORMAT( "Destination already exists dnId:%d. Creation failed.", aDnId);
       
   483                 iDestination = iCmManager->DestinationL( aDnId );
       
   484                 break;
       
   485             default:
       
   486                 CLOG_WRITE( "Destination reading failed.");
       
   487                 break;
       
   488             }
       
   489         }
       
   490     }
       
   491 
   471 // End of File.
   492 // End of File.