Revision: 201015 RCL_3 PDK_3.0.i
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 16:33:37 +0300
branchRCL_3
changeset 16 e00582ce7ecd
parent 15 52d61119153d
child 18 fbb813aef148
Revision: 201015 Kit: 201017
email/pop3andsmtpmtm/clientmtms/inc/CIMPLAINBODYTEXT.H
messagingappbase/mce/src/MceOneRowMessageListArrayLoader.cpp
messagingappbase/mcesettings/src/MceSettingsEmailSel.cpp
messagingappbase/ncnlist/src/NcnOutboxObserver.cpp
messagingappbase/sendui/drmlinksender/Src/DrmLinkSender.cpp
messagingappbase/sendui/genericmtmplugin/src/genericmtmplugin.cpp
messagingappbase/sendui/meetingrequestsender/src/MeetingRequestSender.cpp
messagingappbase/sendui/mmsdirectupload/src/CMmsDirectUpload.cpp
messagingappbase/sendui/mmsindirectupload/src/CMmsIndirectUpload.cpp
mobilemessaging/audiomsg/src/audiomessageappui.cpp
mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp
mobilemessaging/unieditor/application/inc/UniEditorAppUi.h
mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp
mobilemessaging/unieditor/model/bwins/winsU.def
mobilemessaging/unieditor/model/eabi/eabiU.def
mobilemessaging/unieditor/model/inc/UniObject.h
mobilemessaging/unieditor/model/inc/UniObjectList.h
mobilemessaging/unieditor/model/src/UniObject.cpp
mobilemessaging/unieditor/model/src/UniObjectList.cpp
--- a/email/pop3andsmtpmtm/clientmtms/inc/CIMPLAINBODYTEXT.H	Wed Apr 14 15:53:21 2010 +0300
+++ b/email/pop3andsmtpmtm/clientmtms/inc/CIMPLAINBODYTEXT.H	Tue Apr 27 16:33:37 2010 +0300
@@ -16,6 +16,9 @@
 #ifndef _CIMPLAINBODYTEXT_H_
 #define _CIMPLAINBODYTEXT_H_
 
+#include <miuthdr.h>
+#include <miutmsg.h>
+
 class CImEmailMessage;
 class CImStoreMessagePart;
 class CMsgActive;
--- a/messagingappbase/mce/src/MceOneRowMessageListArrayLoader.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/mce/src/MceOneRowMessageListArrayLoader.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -80,6 +80,7 @@
 const TChar KWhiteSpaceCharacter(' ');
 const TInt KSortSubjectStringLength = 100;
 const TInt KMceLoopCounter  = 200;
+const TInt KFirstTimeMceLoopCounter  = 20;
 //cmail update
 #define KUidMsgTypeCmailMtmVal               0x2001F406
 
@@ -569,7 +570,12 @@
 
     TInt entryCount = 0; // divides list building into smaller pieces
     TBool itemAdded = EFalse;
-
+    TInt loopCounter = KMceLoopCounter;
+	if (iCounter == 0)
+        {
+        //For the first time, when the list is about to get populated.
+        loopCounter = KFirstTimeMceLoopCounter;
+        }	
     // Loop until all entries and subtitles has been added to iHCListItemArray
     while ( iEntriesToBeAdded->Count() )
         { 
@@ -668,7 +674,7 @@
                 // This breaks building the array after every KMceLoopCounter entries. 
                 // Necessary for not slowing down execution when there are many messages 
                 // as this is a part of an active scheduler callback.
-                if ( entryCount >= KMceLoopCounter )
+                if ( entryCount >= loopCounter)
                     {
                     iCounter++;
                     break;
@@ -681,6 +687,7 @@
             }
         iCounter++;
         }
+	loopCounter = KMceLoopCounter;
     iStep = 1;
 
     // Update Tree list
--- a/messagingappbase/mcesettings/src/MceSettingsEmailSel.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/mcesettings/src/MceSettingsEmailSel.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -106,6 +106,9 @@
     {
       iEmailFramework = ETrue;
     } 
+    iCmaillistItems = NULL;
+    iCmailBoxes = NULL;
+    iCmaillistItemUids = NULL;
     }
     
 // ---------------------------------------------------------
@@ -128,12 +131,30 @@
     if( iMtmStore )
     	{
     	delete iMtmStore;
+    	iMtmStore = NULL;
     	}     
     if( iMsvSessionPtr )
     	{
     	delete iMsvSessionPtr;
+    	iMsvSessionPtr = NULL;
     	}  	  
     UnLoadResource();    	 	
+    if(iCmaillistItemUids)
+        {
+        delete iCmaillistItemUids;
+        iCmaillistItemUids  = NULL;
+        }
+    if(iCmailBoxes)
+        {
+        iCmailBoxes->Close();
+        delete iCmailBoxes;
+        iCmailBoxes  = NULL;
+        }
+    if(iCmaillistItems)
+        {
+        delete iCmaillistItems;
+        iCmaillistItems = NULL;
+        }
     }    
 
 // ---------------------------------------------------------
@@ -364,10 +385,16 @@
             aMtmType = entry.iMtm;
             }
         }
-    delete iCmaillistItemUids;
-    iCmaillistItemUids  = NULL;
-    delete iCmaillistItems;
-    iCmaillistItems = NULL;;
+    if(iCmaillistItemUids)
+        {
+    	delete iCmaillistItemUids;
+        iCmaillistItemUids  = NULL;
+        }
+    if(iCmaillistItems)
+        {
+   		delete iCmaillistItems;
+        iCmaillistItems = NULL;
+        }
     CleanupStack::PopAndDestroy( aListItemUids );
     CleanupStack::PopAndDestroy( aListItems );
     if(cancel)
@@ -621,12 +648,23 @@
     atimeItems->Sort(key);
     TUid cmailEntryUid;
     
+    if(iCmaillistItems)
+        {
+        delete iCmaillistItems;
+        iCmaillistItems = NULL;
+        }   
     //Array to get the list of Cmail Boxes
     iCmaillistItems = new (ELeave) CDesCArrayFlat(
                                 KArrayGranularity );
     
-    iCmaillistItemUids = new ( ELeave ) CArrayFixFlat<TUid>( KArrayGranularity );
-    
+    if(iCmaillistItemUids)
+        {
+        delete iCmaillistItemUids;
+        iCmaillistItemUids = NULL;
+        }
+    iCmaillistItemUids = new ( ELeave ) 
+            CArrayFixFlat<TUid>( KArrayGranularity );
+   
     // Go one by one in Hash table
     if(atimeItems->Count() > 0)
         {    
@@ -659,6 +697,12 @@
     if(iEmailFramework)
         {
         //Added for Cmail Details
+        if(iCmailBoxes)
+           {
+           iCmailBoxes->Close();
+           delete iCmailBoxes;
+           iCmailBoxes  = NULL;
+           }
         iCmailBoxes =
               new( ELeave )RHashMap< TInt64, TInt >
                       (&TPtrC8Hash , &TInt64Ident);    
@@ -754,8 +798,12 @@
           AppendCmailBoxesL(timeItems, aEntry);
           CleanupStack::PopAndDestroy( cmaillist );
           CleanupStack::PopAndDestroy( timeItems );
-          delete iCmailBoxes;
-          iCmailBoxes = NULL;
+          if(iCmailBoxes)
+              {
+              iCmailBoxes->Close();
+              delete iCmailBoxes;
+              iCmailBoxes = NULL;
+              }
           }
       }
 
--- a/messagingappbase/ncnlist/src/NcnOutboxObserver.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/ncnlist/src/NcnOutboxObserver.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -140,7 +140,7 @@
     CleanupStack::PushL( cmailselection );
     TInt cmailCount= cmailselection ->Count();
     
-    CleanupStack::Pop( 4 );
+    CleanupStack::PopAndDestroy( 4 );
     // Check messagecount in outbox
     msgCount  = msgCount - (smtpCount+pop3Count+ imapCount+cmailCount);
     // Set msg count to the CR key
--- a/messagingappbase/sendui/drmlinksender/Src/DrmLinkSender.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/sendui/drmlinksender/Src/DrmLinkSender.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -130,10 +130,12 @@
 void CDrmLinkSender::PopulateServicesListL(
     RPointerArray<CSendingServiceInfo>& aList )
     {
+    CleanupClosePushL( aList );
     for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ )
         {
         User::LeaveIfError( aList.Append( iServiceArray[cc] ) );
         }
+    CleanupStack::Pop( &aList );
     }
 
 
--- a/messagingappbase/sendui/genericmtmplugin/src/genericmtmplugin.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/sendui/genericmtmplugin/src/genericmtmplugin.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -210,6 +210,9 @@
     		!onlineSharing )
     		{
     		// cancel pressed on "selecta email account" query
+    	    // OR SMTP UID is provided,  
+    	    // but no cmail mailbox is not configured, shonw note to user to
+    	    // configured mailbox and return from here.
     		return;
     		}
     	}
@@ -1262,9 +1265,19 @@
 				}
 			
 			if( service == KMsvUnknownServiceIndexEntryId )
-				{
-				service = EmailDefaultServiceL();		        
-				}
+			    {
+			    //donot launch wizard
+			    // show info note to user to configured
+			    //mailbox from mail app.
+			    CAknGlobalNote* note = CAknGlobalNote::NewL();
+			    CleanupStack::PushL( note );
+			    HBufC* text = NULL;
+			    text = StringLoader::LoadLC( R_SENDUI_SETTINGS_EMAIL_NOT_OK, &iCoeEnv );
+			    note->ShowNoteL( EAknGlobalErrorNote, *text );
+			    CleanupStack::PopAndDestroy( 2, note ); // note, stringLoader
+			    aContinue = EFalse;
+			    return KMsvUnknownServiceIndexEntryId;
+			    }
             }
         else
             {
--- a/messagingappbase/sendui/meetingrequestsender/src/MeetingRequestSender.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/sendui/meetingrequestsender/src/MeetingRequestSender.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -146,10 +146,12 @@
 void CMeetingRequestSender::PopulateServicesListL(
     RPointerArray<CSendingServiceInfo>& aList )
     {
+    CleanupClosePushL( aList );
     for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ )
         {
         User::LeaveIfError( aList.Append( iServiceArray[cc] ) );
         }
+    CleanupStack::Pop( &aList );
     }
 
 // -----------------------------------------------------------------------------
--- a/messagingappbase/sendui/mmsdirectupload/src/CMmsDirectUpload.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/sendui/mmsdirectupload/src/CMmsDirectUpload.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -130,10 +130,12 @@
 void CMmsDirectUpload::PopulateServicesListL(
     RPointerArray<CSendingServiceInfo>& aList )
     {
+    CleanupClosePushL( aList );
     for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ )
         {
         User::LeaveIfError( aList.Append( iServiceArray[cc] ) );         
         }
+    CleanupStack::Pop( &aList );
     }
 
 // -----------------------------------------------------------------------------
--- a/messagingappbase/sendui/mmsindirectupload/src/CMmsIndirectUpload.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/messagingappbase/sendui/mmsindirectupload/src/CMmsIndirectUpload.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -276,10 +276,12 @@
 void CMmsIndirectUpload::PopulateServicesListL(
     RPointerArray<CSendingServiceInfo>& aList )
     {
+    CleanupClosePushL( aList );
     for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ )
         {
         User::LeaveIfError( aList.Append( iServiceArray[cc] ) );         
         }
+    CleanupStack::Pop( &aList );
     }
 
 // -----------------------------------------------------------------------------
--- a/mobilemessaging/audiomsg/src/audiomessageappui.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/audiomsg/src/audiomessageappui.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -3563,10 +3563,6 @@
         iToolbar->SetToolbarVisibility( EFalse, EFalse );     
         }
     
-    if (!(iEditorBaseFeatures & EStayInViewerAfterReply ))
-        {
-        iView->MakeVisible( EFalse );
-        }
     
     ForwardL( KNewMessageFolder );
     if (!(iEditorBaseFeatures & EStayInViewerAfterReply))
--- a/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -1986,11 +1986,7 @@
         User::Leave( KErrDiskFull );
         }
 
-    //to reduce flickering during closing
-	if (!(iEditorBaseFeatures & EStayInViewerAfterReply ))
-        {
-        iView->MakeVisible( EFalse );
-        }
+
         
     TRAPD(err, DoReplyFwdL( aForward ));
     if(!(err == KErrNone) )
--- a/mobilemessaging/unieditor/application/inc/UniEditorAppUi.h	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/application/inc/UniEditorAppUi.h	Tue Apr 27 16:33:37 2010 +0300
@@ -1249,6 +1249,16 @@
          *     Notification from central repository
          */
        	void HandleNotifyInt( TUint32 aId, TInt aNewValue );
+       	
+       	/**
+       	 * Is Inserted objects path are valid.
+       	 * All the media objects are availble in their respective paths. 
+       	 *
+       	 * @return ETrue, if all the media objects are available
+       	 * otherwise EFalse.
+       	 */
+       	TBool IsObjectsPathValidL() const;
+       	        
     private:     // Enumerations
 
     enum TUniEditorFlags
--- a/mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -2968,19 +2968,31 @@
         resourceId = R_QTN_WAIT_MSG_SAVED_OUTBOX;
         }
 
-    iSendOperation = CUniEditorSendOperation::NewL( *this,
-                                                    *Document(),
-                                                    *iHeader,
-                                                    *plugin,
-                                                    *iView,
-                                                    FsSession() );
-    ActivateInputBlockerL( iSendOperation );
-    
-    ShowWaitNoteL( resourceId ); 
-
-    iEditorFlags |= EEditorClosing;
-
-    iSendOperation->Send();
+    if (IsObjectsPathValidL())
+        {
+    	iSendOperation = CUniEditorSendOperation::NewL( *this,
+                                                    	*Document(),
+                                                    	*iHeader,
+                                                    	*plugin,
+                                                    	*iView,
+                                                    	FsSession() );
+        ActivateInputBlockerL(iSendOperation);
+
+        ShowWaitNoteL(resourceId);
+
+        iEditorFlags |= EEditorClosing;
+
+        iSendOperation->Send();
+        }
+    else
+        {
+        if (ShowConfirmationQueryL(R_UNIEDITOR_QUEST_CLOSE_OOD))
+            {
+            // Exit without saving.
+            Exit(EAknSoftkeyClose);
+            }
+        //else nothing.
+        }
     }
 
 
@@ -3017,7 +3029,7 @@
         }
     else if ( ( Document()->Modified() || 
                 Document()->PrevSaveType() < EClosingSave ) && 
-              CanSaveMessageL() )
+              CanSaveMessageL())
         {
         // Needs saving
         if ( IsForeground() )
@@ -3060,14 +3072,24 @@
         {
         iEditorFlags |= ERunAppShutterAtExit;
         }
-        
-    if ( iEditorFlags & ELaunchSuccessful &&  
-         Document()->MediaAvailable() )
-        {
-        DoMsgSaveExitL();
-        }
-        
-    Exit(); 
+    if (IsObjectsPathValidL())
+        {
+        if (iEditorFlags & ELaunchSuccessful && Document()->MediaAvailable())
+            {
+            DoMsgSaveExitL();
+            }
+
+        Exit();
+        }
+    else
+        {
+        if (ShowConfirmationQueryL(R_UNIEDITOR_QUEST_CLOSE_OOD))
+            {
+            // Exit without saving.
+            Exit(EAknSoftkeyClose);
+            }
+        }
+    
     }
 
 // ---------------------------------------------------------
@@ -3102,7 +3124,7 @@
             // Message has data
             if ( Document()->Modified() || Document()->PrevSaveType() < EClosingSave )
                 {
-                if ( CanSaveMessageL() )
+                if ( CanSaveMessageL() && IsObjectsPathValidL())                    
                     {
                     TInt resId = Document()->Saved() ? R_QTN_UNI_WAIT_SAVING_MESSAGE : 
                                                        R_QTN_UNI_WAIT_SAVING_MESSAGE_NEW;
@@ -9857,6 +9879,28 @@
             iTapConsumed = ETrue;
             }
         }   
-    }  
+    }
+
+// ---------------------------------------------------------
+// CUniEditorAppUi::IsObjectPathValidL
+// Checks whether all inserted object's path are valid
+// message.
+// ---------------------------------------------------------
+//
+TBool CUniEditorAppUi::IsObjectsPathValidL() const
+    {
+    TBool bCanSave = ETrue;  
+    if ( Document()->DataModel()->SmilType() == EMmsSmil )
+        {
+        bCanSave = Document()->DataModel()->ObjectList().IsListValid();
+        
+        if(bCanSave)
+            {
+            bCanSave = Document()->DataModel()->AttachmentList().IsListValid();
+            }
+        }      
+    return bCanSave;
+    }
+
 // End of file
 
--- a/mobilemessaging/unieditor/model/bwins/winsU.def	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/bwins/winsU.def	Tue Apr 27 16:33:37 2010 +0300
@@ -101,4 +101,6 @@
 	?RemoveObserver@CUniObject@@QAEXPAVMUniObjectObserver@@@Z @ 100 NONAME ; void CUniObject::RemoveObserver(class MUniObjectObserver *)
 	?SetObserverL@CUniObject@@QAEXPAVMUniObjectObserver@@@Z @ 101 NONAME ; void CUniObject::SetObserverL(class MUniObjectObserver *)
 	?SetDrmRightsWhenLoadedObjects@CUniObject@@QAEXH@Z @ 102 NONAME ; void CUniObject::SetDrmRightsWhenLoadedObjects(int)
+	?IsListValid@CUniObjectList@@QBEHXZ @ 103 NONAME ; int CUniObjectList::IsListValid(void) const
+	?IsValid@CUniObject@@QBEHXZ @ 104 NONAME ; int CUniObject::IsValid(void) const
 
--- a/mobilemessaging/unieditor/model/eabi/eabiU.def	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/eabi/eabiU.def	Tue Apr 27 16:33:37 2010 +0300
@@ -128,4 +128,6 @@
 	_ZN10CUniObject12SetObserverLEP18MUniObjectObserver @ 127 NONAME
 	_ZN10CUniObject14RemoveObserverEP18MUniObjectObserver @ 128 NONAME
 	_ZN10CUniObject29SetDrmRightsWhenLoadedObjectsEi @ 129 NONAME
+	_ZNK10CUniObject7IsValidEv @ 130 NONAME
+	_ZNK14CUniObjectList11IsListValidEv @ 131 NONAME
 
--- a/mobilemessaging/unieditor/model/inc/UniObject.h	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/inc/UniObject.h	Tue Apr 27 16:33:37 2010 +0300
@@ -482,6 +482,14 @@
         *           
         */
         IMPORT_C void RemoveObserver(   MUniObjectObserver*     aObserver );
+        
+        /**
+         * Is object path is valid
+         *
+         * @return ETrue, if media object is available in their respective path 
+         * otherwise EFalse
+         */
+        IMPORT_C TBool IsValid() const;
 
     protected: 
 
--- a/mobilemessaging/unieditor/model/inc/UniObjectList.h	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/inc/UniObjectList.h	Tue Apr 27 16:33:37 2010 +0300
@@ -263,6 +263,15 @@
         * @return   Number of objects
         */
         inline TInt Count() const;
+        
+        /**
+         * Is object list valid.
+         * All the media objects are availble in their respective paths. 
+         *
+         * @return ETrue, if all the media objects are available
+         * otherwise EFalse.
+         */
+        IMPORT_C TBool IsListValid() const;
 
     public:
     
--- a/mobilemessaging/unieditor/model/src/UniObject.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/src/UniObject.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -596,8 +596,8 @@
         SetAttachment( isAttachment );
         }
 
-    CMsvAttachment::TMsvAttachmentType type = aAttachment.Type();
-    if ( type == CMsvAttachment::EMsvLinkedFile )
+    iSaveType = aAttachment.Type();
+    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
         {
         iFileHandle = aManager.GetAttachmentFileL( iAttachmentId  );
         }
@@ -761,5 +761,32 @@
             }
         }
     }
-       
+
+// ---------------------------------------------------------
+// CUniObject::IsValid
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniObject::IsValid() const
+    {
+    TBool bFlag = ETrue;
+    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
+        {
+        TParsePtrC fileParse( iMediaInfo->FullFilePath() );
+        
+        RFile file;     
+        TInt err = file.Open( iFs, fileParse.FullName(), EFileShareAny );
+      
+        if(err == KErrNotReady)
+            {
+            bFlag = EFalse;
+            }
+        if(err == KErrNone)
+            {
+            file.Close();
+            }
+        }
+    return bFlag;
+    }
+
 // EOF
--- a/mobilemessaging/unieditor/model/src/UniObjectList.cpp	Wed Apr 14 15:53:21 2010 +0300
+++ b/mobilemessaging/unieditor/model/src/UniObjectList.cpp	Tue Apr 27 16:33:37 2010 +0300
@@ -524,4 +524,26 @@
         }
     }
 
+// ---------------------------------------------------------
+// CUniObjectList::IsListValid
+//
+// IsListValid
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniObjectList::IsListValid() const
+    {
+    TBool bFlag = ETrue;
+    
+    if(iObjectArray)
+        {
+        TInt count = iObjectArray->Count() ;
+    
+        for(TInt i =0; (i < count) && bFlag ; i++)
+            {
+            bFlag = iObjectArray->At( i )->IsValid();
+            }
+        }
+    return bFlag;
+    }
+
 // EOF