messagingappbase/mce/src/MceOneRowMessageListArrayLoader.cpp
branchRCL_3
changeset 24 e00582ce7ecd
parent 22 52d61119153d
child 29 7e4e4bcc75b6
equal deleted inserted replaced
22:52d61119153d 24:e00582ce7ecd
    78 
    78 
    79 _LIT( KSortSubjectSkipString, "*:*" );
    79 _LIT( KSortSubjectSkipString, "*:*" );
    80 const TChar KWhiteSpaceCharacter(' ');
    80 const TChar KWhiteSpaceCharacter(' ');
    81 const TInt KSortSubjectStringLength = 100;
    81 const TInt KSortSubjectStringLength = 100;
    82 const TInt KMceLoopCounter  = 200;
    82 const TInt KMceLoopCounter  = 200;
       
    83 const TInt KFirstTimeMceLoopCounter  = 20;
    83 //cmail update
    84 //cmail update
    84 #define KUidMsgTypeCmailMtmVal               0x2001F406
    85 #define KUidMsgTypeCmailMtmVal               0x2001F406
    85 
    86 
    86 // ================= MEMBER FUNCTIONS =======================
    87 // ================= MEMBER FUNCTIONS =======================
    87 
    88 
   567     CArrayFixFlat<TInt>* itemsAdded = new (ELeave) CArrayFixFlat<TInt>(4);
   568     CArrayFixFlat<TInt>* itemsAdded = new (ELeave) CArrayFixFlat<TInt>(4);
   568     CleanupStack::PushL( itemsAdded );
   569     CleanupStack::PushL( itemsAdded );
   569 
   570 
   570     TInt entryCount = 0; // divides list building into smaller pieces
   571     TInt entryCount = 0; // divides list building into smaller pieces
   571     TBool itemAdded = EFalse;
   572     TBool itemAdded = EFalse;
   572 
   573     TInt loopCounter = KMceLoopCounter;
       
   574 	if (iCounter == 0)
       
   575         {
       
   576         //For the first time, when the list is about to get populated.
       
   577         loopCounter = KFirstTimeMceLoopCounter;
       
   578         }	
   573     // Loop until all entries and subtitles has been added to iHCListItemArray
   579     // Loop until all entries and subtitles has been added to iHCListItemArray
   574     while ( iEntriesToBeAdded->Count() )
   580     while ( iEntriesToBeAdded->Count() )
   575         { 
   581         { 
   576          TBool nonCmailEntry = ETrue; 
   582          TBool nonCmailEntry = ETrue; 
   577          if ( iEmailFramework )
   583          if ( iEmailFramework )
   666                     }
   672                     }
   667                 
   673                 
   668                 // This breaks building the array after every KMceLoopCounter entries. 
   674                 // This breaks building the array after every KMceLoopCounter entries. 
   669                 // Necessary for not slowing down execution when there are many messages 
   675                 // Necessary for not slowing down execution when there are many messages 
   670                 // as this is a part of an active scheduler callback.
   676                 // as this is a part of an active scheduler callback.
   671                 if ( entryCount >= KMceLoopCounter )
   677                 if ( entryCount >= loopCounter)
   672                     {
   678                     {
   673                     iCounter++;
   679                     iCounter++;
   674                     break;
   680                     break;
   675                     }
   681                     }
   676                 }
   682                 }
   679             {
   685             {
   680             iEntriesToBeAdded->Delete( 0 );
   686             iEntriesToBeAdded->Delete( 0 );
   681             }
   687             }
   682         iCounter++;
   688         iCounter++;
   683         }
   689         }
       
   690 	loopCounter = KMceLoopCounter;
   684     iStep = 1;
   691     iStep = 1;
   685 
   692 
   686     // Update Tree list
   693     // Update Tree list
   687     if ( iListItemArrayObserver && itemAdded )
   694     if ( iListItemArrayObserver && itemAdded )
   688         {
   695         {