diff -r e8f259fad141 -r c3c9c6dcfb80 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp Tue May 25 12:23:16 2010 +0300 @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -28,13 +27,6 @@ // DEBUG #include "emailtrace.h" -// Unnamed namespace for local definitions -namespace { // codescanner::namespace - -// Notepad data type -_LIT8( KNotePadTextDataType, "text/plain" ); - -} // ======== MEMBER FUNCTIONS ======== @@ -48,7 +40,7 @@ { FUNC_LOG; } - + // --------------------------------------------------------------------------- // CMROpenAttachmentCommand::CMROpenAttachmentCommand // --------------------------------------------------------------------------- @@ -66,7 +58,7 @@ CDocumentHandler& aDocHandler ) { FUNC_LOG; - + CMROpenAttachmentCommand* self = new (ELeave) CMROpenAttachmentCommand( aDocHandler ); CleanupStack::PushL( self ); @@ -93,35 +85,21 @@ TInt aAttachmentIndex ) { FUNC_LOG; - + // Ownership not gained CCalAttachmentFile* attachmentFile = - aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); + aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); RFile file; attachmentFile->FetchFileHandleL( file ); CleanupClosePushL( file ); - - TDataType datatype( + + TDataType datatype( aEntry.AttachmentL( aAttachmentIndex )->MimeType() ); - - TInt err( KErrNone ); - if( datatype == KNotePadTextDataType() ) - { - // Notepad will try to open text/plain type data - err = CNotepadApi::ExecFileViewerL( - file, - NULL, - ETrue, - EFalse, - KCharacterSetIdentifierIso88591 ); - } - else - { - // Doc handler will try to open other than text files - TRAP( err, iDocHandler.OpenFileEmbeddedL( file, datatype ) ); - } - + + // Doc handler will try to open file + TRAPD( err, iDocHandler.OpenFileEmbeddedL( file, datatype ) ); + CleanupStack::PopAndDestroy( &file ); if( err != KErrNone )