diff -r 4c83dcfb6f1a -r 984e13af52c4 dbcreator/commsdatcreator/Src/cdcprocessordn.cpp --- a/dbcreator/commsdatcreator/Src/cdcprocessordn.cpp Mon Jun 21 16:06:29 2010 +0300 +++ b/dbcreator/commsdatcreator/Src/cdcprocessordn.cpp Thu Jul 15 19:05:04 2010 +0300 @@ -145,16 +145,7 @@ break; } } - if (dnId == -1) - { - iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName ); - CLOG_WRITE( "Destinaton created without dnId."); - } - else - { - iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName, dnId); - CLOG_WRITE_FORMAT( "Destinaton created. dnId:%d", dnId); - } + CreateDestination(dnId); } HBufC *destName( NULL ); @@ -468,4 +459,34 @@ CleanupStack::PopAndDestroy( tmp ); // Removes tmp. } +// --------------------------------------------------------- +// CProcessorDN::CreateDestination +// --------------------------------------------------------- +// +void CProcessorDN::CreateDestination(TInt aDnId) + { + if (aDnId == -1) + { + iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName ); + CLOG_WRITE( "Destinaton created without dnId."); + } + else + { + TRAPD( err, iDestination = iCmManager->CreateDestinationL( KDefaultDestinationName, aDnId ) ); + switch ( err ) + { + case KErrNone: + CLOG_WRITE_FORMAT( "Destination created. dnId:%d", aDnId); + break; + case KErrAlreadyExists: + CLOG_WRITE_FORMAT( "Destination already exists dnId:%d. Creation failed.", aDnId); + iDestination = iCmManager->DestinationL( aDnId ); + break; + default: + CLOG_WRITE( "Destination reading failed."); + break; + } + } + } + // End of File.