messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp
changeset 52 12db4185673b
parent 43 35b64624a9e7
equal deleted inserted replaced
44:36f374c67aa8 52:12db4185673b
    50 {
    50 {
    51     q_ptr = NULL;
    51     q_ptr = NULL;
    52     
    52     
    53     if(attachmentProcessed == EFalse && iAttachmentCount == 1)
    53     if(attachmentProcessed == EFalse && iAttachmentCount == 1)
    54     {
    54     {
    55         CMsvStore* store = iMsvEntry->EditStoreL();
    55        TRAP_IGNORE( CMsvStore* store = iMsvEntry->EditStoreL();
    56         CleanupStack::PushL(store);
    56         CleanupStack::PushL(store);
    57         MMsvAttachmentManagerSync& attachMan = store->AttachmentManagerExtensionsL();
    57         MMsvAttachmentManagerSync& attachMan = store->AttachmentManagerExtensionsL();
    58         attachMan.RemoveAttachmentL(0);
    58         attachMan.RemoveAttachmentL(0);
    59         CleanupStack::PopAndDestroy();
    59         CleanupStack::PopAndDestroy(););
    60     }
    60     }
    61     
    61     
    62     if (iMsvEntry) {
    62     if (iMsvEntry) {
    63         delete iMsvEntry;
    63         delete iMsvEntry;
    64     }
    64     }
    73 // UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate
    73 // UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate
    74 // @see header
    74 // @see header
    75 //---------------------------------------------------------------
    75 //---------------------------------------------------------------
    76 UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin) :
    76 UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin) :
    77     q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL),
    77     q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL),
    78             iMsvEntry(NULL)
    78             iMsvEntry(NULL),iAttachmentCount(0)
    79 {
    79 {
    80     iMSession = CMsvSession::OpenSyncL(*this);
    80     iMSession = CMsvSession::OpenSyncL(*this);
    81     done = EFalse;
    81     done = EFalse;
    82 }
    82 }
    83 
    83 
   245     if (attachmentProcessed) {
   245     if (attachmentProcessed) {
   246 
   246 
   247         CMsvStore* store1 = iMsvEntry->ReadStoreL();
   247         CMsvStore* store1 = iMsvEntry->ReadStoreL();
   248         CleanupStack::PushL(store1);
   248         CleanupStack::PushL(store1);
   249         MMsvAttachmentManager& attachMan = store1->AttachmentManagerL();
   249         MMsvAttachmentManager& attachMan = store1->AttachmentManagerL();
   250         RFile file = attachMan.GetAttachmentFileL(0);
   250         RFile file;
       
   251 		
       
   252         if (iAttachmentCount > 0)
       
   253         {
       
   254             file = attachMan.GetAttachmentFileL(0);
       
   255         }
       
   256             
   251         CleanupStack::PopAndDestroy(store1);
   257         CleanupStack::PopAndDestroy(store1);
   252         return file;
   258         return file;
   253     }
   259     }
   254 
   260 
   255     RFile file;
   261     RFile file;