calendarui/controller/src/calenattachmentui.cpp
branchRCL_3
changeset 60 96907930389d
parent 30 d68a4b5d5885
child 67 1539a383d7b6
equal deleted inserted replaced
59:aba12c885d83 60:96907930389d
   157             
   157             
   158             if(!iAddAttachmentFromViewer && (attachmentInfoList.Count()))
   158             if(!iAddAttachmentFromViewer && (attachmentInfoList.Count()))
   159                 {                                
   159                 {                                
   160                 iAttachmentModel->Reset();
   160                 iAttachmentModel->Reset();
   161                 iController.BroadcastNotification(ECalenNotifyAttachmentRemoved);
   161                 iController.BroadcastNotification(ECalenNotifyAttachmentRemoved);
   162                 RemoveTemporaryFiles();
   162                 RemoveTemporaryFilesL();
   163                 }                    
   163                 }                    
   164             else
   164             else
   165                 {
   165                 {
   166                 iAttachmentModel->DeleteAttachment(0);
   166                 iAttachmentModel->DeleteAttachment(0);
   167                 }
   167                 }
   220             if(!(iAddAttachmentFromViewer))
   220             if(!(iAddAttachmentFromViewer))
   221                 {
   221                 {
   222                 iAttachmentModel->Reset();
   222                 iAttachmentModel->Reset();
   223                 } 
   223                 } 
   224             // clear calendar editor's folder
   224             // clear calendar editor's folder
   225             RemoveTemporaryFiles();
   225             RemoveTemporaryFilesL();
   226             iAttachmentInfoIntialized = EFalse;
   226             iAttachmentInfoIntialized = EFalse;
   227             }
   227             }
   228             break;            
   228             break;            
   229         case ECalenNotifyEntryClosed:
   229         case ECalenNotifyEntryClosed:
   230         case ECalenNotifyMarkedEntryDeleted:
   230         case ECalenNotifyMarkedEntryDeleted:
   249                 if(!iController.IsEditorActive())
   249                 if(!iController.IsEditorActive())
   250                     {
   250                     {
   251                     // add attachments to the entry being viewed in event viewer
   251                     // add attachments to the entry being viewed in event viewer
   252                     AddAttachmentsToEntryL();
   252                     AddAttachmentsToEntryL();
   253                     // clear calendar editor's folder
   253                     // clear calendar editor's folder
   254                     RemoveTemporaryFiles();
   254                     RemoveTemporaryFilesL();
   255                     
   255                     
   256                     iAttachmentModel->Reset();
   256                     iAttachmentModel->Reset();
   257                     }
   257                     }
   258                 
   258                 
   259                 iAddAttachmentFromViewer = EFalse;
   259                 iAddAttachmentFromViewer = EFalse;
   564         {
   564         {
   565         CheckForExistingAttachmentsL();
   565         CheckForExistingAttachmentsL();
   566         }
   566         }
   567     
   567     
   568     TBool isAlreadyExists = IsDuplicateNameL(parsedFileName);
   568     TBool isAlreadyExists = IsDuplicateNameL(parsedFileName);
   569     CheckDRMStatus(aSourceFilePath,drmProtected);
   569     CheckDRMStatusL(aSourceFilePath,drmProtected);
   570     
   570     
   571     if(drmProtected || isAlreadyExists)
   571     if(drmProtected || isAlreadyExists)
   572         {
   572         {
   573         iAttachmentAlreadyExists = ETrue;
   573         iAttachmentAlreadyExists = ETrue;
   574         iController.BroadcastNotification(ECalenNotifyDialogClosed);
   574         iController.BroadcastNotification(ECalenNotifyDialogClosed);
   833 
   833 
   834 // -----------------------------------------------------------------------------
   834 // -----------------------------------------------------------------------------
   835 // CCalenAttachmentUi::CheckDRMStatus()
   835 // CCalenAttachmentUi::CheckDRMStatus()
   836 // -----------------------------------------------------------------------------
   836 // -----------------------------------------------------------------------------
   837 // 
   837 // 
   838 void CCalenAttachmentUi::CheckDRMStatus( const TDesC& aFileName,TBool& aProtection )
   838 void CCalenAttachmentUi::CheckDRMStatusL( const TDesC& aFileName,TBool& aProtection )
   839     {
   839     {
   840     TRACE_ENTRY_POINT;
   840     TRACE_ENTRY_POINT;
   841     
   841     
   842     RFile file; 
   842     RFile file; 
   843     file.Close();
   843     file.Close();
   918 // -----------------------------------------------------------------------------
   918 // -----------------------------------------------------------------------------
   919 // CCalenAttachmentUi::CompareContentOfTextFiles()
   919 // CCalenAttachmentUi::CompareContentOfTextFiles()
   920 // Compares the binary data of already attached and currently selected text file.
   920 // Compares the binary data of already attached and currently selected text file.
   921 // -----------------------------------------------------------------------------
   921 // -----------------------------------------------------------------------------
   922 // 
   922 // 
   923 TBool CCalenAttachmentUi::CompareContentOfTextFiles( const TDesC& aSelectedFile,
   923 TBool CCalenAttachmentUi::CompareContentOfTextFilesL( const TDesC& aSelectedFile,
   924                                     const TDesC& aAlreadyAttachedFile)
   924                                     const TDesC& aAlreadyAttachedFile)
   925     {
   925     {
   926     TRACE_ENTRY_POINT;
   926     TRACE_ENTRY_POINT;
   927     
   927     
   928     TBool matchFound(EFalse);
   928     TBool matchFound(EFalse);
   981 // -----------------------------------------------------------------------------
   981 // -----------------------------------------------------------------------------
   982 // CCalenAttachmentUi::RemoveTemporaryFiles()
   982 // CCalenAttachmentUi::RemoveTemporaryFiles()
   983 // removes the temporary files, those we have added to temp path.
   983 // removes the temporary files, those we have added to temp path.
   984 // -----------------------------------------------------------------------------
   984 // -----------------------------------------------------------------------------
   985 // 
   985 // 
   986 void CCalenAttachmentUi::RemoveTemporaryFiles()
   986 void CCalenAttachmentUi::RemoveTemporaryFilesL()
   987     {
   987     {
   988     TRACE_ENTRY_POINT;
   988     TRACE_ENTRY_POINT;
   989     
   989     
   990     CEikonEnv* eikonEnv = CEikonEnv::Static();
   990     CEikonEnv* eikonEnv = CEikonEnv::Static();
   991     CFileMan* fileMan = CFileMan::NewL( eikonEnv->FsSession() );
   991     CFileMan* fileMan = CFileMan::NewL( eikonEnv->FsSession() );