--- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Fri Jul 23 17:48:16 2010 -0500
+++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Fri Aug 06 17:13:32 2010 -0500
@@ -110,14 +110,8 @@
if ( mime->CompareF( KMimeTypeAudio3gpp ) == 0
|| mime->CompareF( KMimeTypeVideo3gpp ) == 0 )
{
- delete mime;
- mime = NULL;
format = EMTPFormatCode3GPContainer;
}
- }
-
- if ( mime != NULL )
- {
delete mime;
mime = NULL;
}
@@ -525,34 +519,15 @@
HBufC8* MmMtpDpUtility::OdfMimeTypeL( const TDesC& aFullPath )
{
PRINT( _L( "MM MTP => MmMtpDpUtility::OdfMimeTypeL" ) );
- HBufC8* mimebuf = NULL;
- CContent* content = CContent::NewL( aFullPath );
- CleanupStack::PushL( content ); // + content
-
- HBufC* buffer = HBufC::NewL( KMimeTypeMaxLength );
- CleanupStack::PushL( buffer ); // + buffer
+ CContent* content = CContent::NewLC( aFullPath ); // + content
+ HBufC* buffer = HBufC::NewLC( KMimeTypeMaxLength ); // + buffer
TPtr data = buffer->Des();
- TInt err = content->GetStringAttribute( EMimeType, data );
-
- if ( err == KErrNone )
- {
- mimebuf = HBufC8::New( buffer->Length() );
+ User::LeaveIfError( content->GetStringAttribute( EMimeType, data ) );
- if ( mimebuf == NULL )
- {
- User::LeaveIfError( KErrNotFound );
- }
-
- mimebuf->Des().Copy( *buffer );
- }
-
- // leave if NULL
- if ( mimebuf == NULL )
- {
- User::Leave( KErrNotFound );
- }
+ HBufC8* mimebuf = HBufC8::NewL( buffer->Length() );
+ mimebuf->Des().Copy( *buffer );
CleanupStack::PopAndDestroy( buffer ); // - buffer
CleanupStack::PopAndDestroy( content ); // - content