mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp
branchRCL_3
changeset 23 e42293e811d8
parent 17 6f9f6e99a23e
child 24 6c1dfe4da5dd
equal deleted inserted replaced
22:b034b1c214c2 23:e42293e811d8
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Extended collection helper with an internal caching array
    14 * Description:  Extended collection helper with an internal caching array
    15 *  Version     : %version: da1mmcf#27.1.12.1.2 % 
    15 *  Version     : %version: e003sa33#27.1.12.1.3 % 
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #include <e32base.h>
    20 #include <e32base.h>
   393         }
   393         }
   394     
   394     
   395     // Not found in the array
   395     // Not found in the array
   396     if( !media )
   396     if( !media )
   397         {
   397         {
       
   398         // If the catched count is more than KCacheCount, commit it to database.
       
   399         if( count >= KCacheCount )
       
   400             {
       
   401             Commit();
       
   402             }
   398         CMPXMedia* copy = CMPXMedia::NewL( *aMedia );
   403         CMPXMedia* copy = CMPXMedia::NewL( *aMedia );
   399         CleanupStack::PushL( copy );
   404         CleanupStack::PushL( copy );
   400         iCache->AppendL( copy );  // ownership x-fer
   405         iCache->AppendL( copy );  // ownership x-fer
   401         CleanupStack::Pop( copy );
   406         CleanupStack::Pop( copy );
   402         iOp.AppendL( ESet );
   407         iOp.AppendL( ESet );