videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp
changeset 24 7d93ee07fb27
parent 17 69946d1824c4
child 46 adbe7d5ba2f5
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp	Fri May 14 15:53:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbums.cpp	Thu May 27 12:53:14 2010 +0300
@@ -49,6 +49,7 @@
 void CVcxMyVideosAlbums::ConstructL()
     {
     iAlbums.Reset();
+    iChangedAlbums.Reset();
     }
 
 // ---------------------------------------------------------------------------
@@ -81,6 +82,7 @@
     iMdsOpResults.Close();
     iMdsOpResultsUint32.Close();
     iRemoveFromAlbumVideos.Close();
+    iChangedAlbums.Close();
     }
     
 // ----------------------------------------------------------------------------
@@ -766,4 +768,39 @@
     NewVideoFlagChangedL( aMdsId ); // same calculation works for this
     }
 
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL( CMPXMedia& aVideo )
+    {
+    TInt count = iAlbums.Count();
+    TUint32 mdsId = TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1;
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iAlbums[i]->BelongsToAlbum( mdsId ) )
+            {
+            if ( iChangedAlbums.Find( i ) == KErrNotFound )
+                {
+                iChangedAlbums.AppendL( i );
+                }
+            }
+        }    
+    }
+// ----------------------------------------------------------------------------
+// CVcxMyVideosAlbums::UpdateChangedAlbumsL
+// ----------------------------------------------------------------------------
+//
+void CVcxMyVideosAlbums::UpdateChangedAlbumsL()
+    {
+    TInt count = iChangedAlbums.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        iCollection.iMessageList->AddEventL(
+                TMPXItemId( iAlbums[iChangedAlbums[i]]->iMdsId, KVcxMvcMediaTypeAlbum ),
+                EMPXItemModified, EVcxMyVideosVideoListOrderChanged );
+        iAlbums[iChangedAlbums[i]]->CalculateAttributesL();
+        }
+    iChangedAlbums.Reset();
+    }
 // END OF FILE