# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272375217 -10800 # Node ID e00582ce7ecd38a96baa27e8a364cd50d07b0c8e # Parent 52d61119153d2ec28e38aab2c25985b4960fd0a1 Revision: 201015 Kit: 201017 diff -r 52d61119153d -r e00582ce7ecd email/pop3andsmtpmtm/clientmtms/inc/CIMPLAINBODYTEXT.H --- 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 +#include + class CImEmailMessage; class CImStoreMessagePart; class CMsgActive; diff -r 52d61119153d -r e00582ce7ecd messagingappbase/mce/src/MceOneRowMessageListArrayLoader.cpp --- 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 diff -r 52d61119153d -r e00582ce7ecd messagingappbase/mcesettings/src/MceSettingsEmailSel.cpp --- 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( KArrayGranularity ); - + if(iCmaillistItemUids) + { + delete iCmaillistItemUids; + iCmaillistItemUids = NULL; + } + iCmaillistItemUids = new ( ELeave ) + CArrayFixFlat( 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; + } } } diff -r 52d61119153d -r e00582ce7ecd messagingappbase/ncnlist/src/NcnOutboxObserver.cpp --- 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 diff -r 52d61119153d -r e00582ce7ecd messagingappbase/sendui/drmlinksender/Src/DrmLinkSender.cpp --- 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& aList ) { + CleanupClosePushL( aList ); for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ ) { User::LeaveIfError( aList.Append( iServiceArray[cc] ) ); } + CleanupStack::Pop( &aList ); } diff -r 52d61119153d -r e00582ce7ecd messagingappbase/sendui/genericmtmplugin/src/genericmtmplugin.cpp --- 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 { diff -r 52d61119153d -r e00582ce7ecd messagingappbase/sendui/meetingrequestsender/src/MeetingRequestSender.cpp --- 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& aList ) { + CleanupClosePushL( aList ); for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ ) { User::LeaveIfError( aList.Append( iServiceArray[cc] ) ); } + CleanupStack::Pop( &aList ); } // ----------------------------------------------------------------------------- diff -r 52d61119153d -r e00582ce7ecd messagingappbase/sendui/mmsdirectupload/src/CMmsDirectUpload.cpp --- 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& aList ) { + CleanupClosePushL( aList ); for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ ) { User::LeaveIfError( aList.Append( iServiceArray[cc] ) ); } + CleanupStack::Pop( &aList ); } // ----------------------------------------------------------------------------- diff -r 52d61119153d -r e00582ce7ecd messagingappbase/sendui/mmsindirectupload/src/CMmsIndirectUpload.cpp --- 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& aList ) { + CleanupClosePushL( aList ); for ( TInt cc = 0; cc < iServiceArray.Count(); cc++ ) { User::LeaveIfError( aList.Append( iServiceArray[cc] ) ); } + CleanupStack::Pop( &aList ); } // ----------------------------------------------------------------------------- diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/audiomsg/src/audiomessageappui.cpp --- 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)) diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/smsui/viewersrc/MsgSmsViewerAppUi.cpp --- 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) ) diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/application/inc/UniEditorAppUi.h --- 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 diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/application/src/UniEditorAppUi.cpp --- 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 diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/bwins/winsU.def --- 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 diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/eabi/eabiU.def --- 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 diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/inc/UniObject.h --- 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: diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/inc/UniObjectList.h --- 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: diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/src/UniObject.cpp --- 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 diff -r 52d61119153d -r e00582ce7ecd mobilemessaging/unieditor/model/src/UniObjectList.cpp --- 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