videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp
changeset 15 cf5481c2bc0b
parent 0 96612d01cf9f
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
   180     RArray<TInt> newVideosIncrements;
   180     RArray<TInt> newVideosIncrements;
   181     newVideosIncrements.Reset();
   181     newVideosIncrements.Reset();
   182     CleanupClosePushL( newVideosIncrements ); // 2->
   182     CleanupClosePushL( newVideosIncrements ); // 2->
   183 
   183 
   184     TInt i;
   184     TInt i;
       
   185     videosIncrements.ReserveL( categoryCount );
       
   186     newVideosIncrements.ReserveL( categoryCount );
   185     for ( i = 0; i < categoryCount; i++ )
   187     for ( i = 0; i < categoryCount; i++ )
   186         {
   188         {
   187         videosIncrements.AppendL( 0 );
   189         videosIncrements.AppendL( 0 );
   188         newVideosIncrements.Append( 0 );
   190         newVideosIncrements.Append( 0 );
   189         }
   191         }
   278         {
   280         {
   279         if ( aVideosIncrements[i] != 0 )
   281         if ( aVideosIncrements[i] != 0 )
   280             {
   282             {
   281             category = aCategoryArray.AtL( i );
   283             category = aCategoryArray.AtL( i );
   282 
   284 
   283             UpdateVideosCountL( *category, aVideosIncrements[i], KVcxMediaMyVideosCategoryItemCount,
   285             //codescanner warning: aVideosIncrements count is same as aCategoryArray count, so the range is checked
   284                     EVcxMyVideosListNoInfo );
   286             UpdateVideosCountL( *category, aVideosIncrements[i],
       
   287                     KVcxMediaMyVideosCategoryItemCount, EVcxMyVideosListNoInfo );
   285 
   288 
   286             modified = ETrue;
   289             modified = ETrue;
   287             }
   290             }
   288 
   291 
       
   292         //codescanner warning: aNewVideosIncrements count is same as aCategoryArray count, so the range is checked
   289         if ( aNewVideosIncrements[i] != 0 )
   293         if ( aNewVideosIncrements[i] != 0 )
   290             {
   294             {
   291             category = aCategoryArray.AtL( i );
   295             category = aCategoryArray.AtL( i );
   292 
   296 
   293             UpdateVideosCountL( *category, aNewVideosIncrements[i], KVcxMediaMyVideosCategoryNewItemCount,
   297             UpdateVideosCountL( *category, aNewVideosIncrements[i],
   294                     EVcxMyVideosListNoInfo );
   298                     KVcxMediaMyVideosCategoryNewItemCount, EVcxMyVideosListNoInfo );
   295 
   299 
   296             modified = ETrue;
   300             modified = ETrue;
   297             }
   301             }
   298 
   302 
   299         }
   303         }
   685     TInt categoryIndex = CategoryIndex( aOrigin );
   689     TInt categoryIndex = CategoryIndex( aOrigin );
   686      
   690      
   687     prevNewVideoName.Set( iListArray->AtL( categoryIndex )->ValueText(
   691     prevNewVideoName.Set( iListArray->AtL( categoryIndex )->ValueText(
   688             KVcxMediaMyVideosCategoryNewItemName ) );
   692             KVcxMediaMyVideosCategoryNewItemName ) );
   689     CMPXMedia* newVideo;
   693     CMPXMedia* newVideo;
   690     currentNewVideoName.Set( CalculateNewVideoNameL( *videoList, aOrigin, aIgnoredIds, newVideo ) );
   694     currentNewVideoName.Set( CalculateNewVideoNameL(
       
   695             *videoList, aOrigin, aIgnoredIds, newVideo ) );
   691     if ( currentNewVideoName.CompareF( prevNewVideoName ) != 0 )
   696     if ( currentNewVideoName.CompareF( prevNewVideoName ) != 0 )
   692         {
   697         {
   693         iListArray->AtL( categoryIndex )->SetTextValueL(
   698         iListArray->AtL( categoryIndex )->SetTextValueL(
   694                 KVcxMediaMyVideosCategoryNewItemName, currentNewVideoName );
   699                 KVcxMediaMyVideosCategoryNewItemName, currentNewVideoName );
   695         MPX_DEBUG3("CVcxMyVideosCategories:: Category[%d] New Video Name changed to %S",
   700         MPX_DEBUG3("CVcxMyVideosCategories:: Category[%d] New Video Name changed to %S",