diff -r 315810614048 -r 839377eedc2b videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Thu Aug 19 09:57:17 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscollectionplugin.cpp Tue Aug 31 15:15:55 2010 +0300 @@ -442,7 +442,11 @@ CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 ); CategoriesL().UpdateCategoriesNewVideoNamesL(); -#ifdef VCX_ALBUMS +#ifdef VCX_ALBUMS + // Adds changed album indexes to Albums().iChangedAlbums. + // AlbumsL().UpdateChangedAlbumsL() will update the changed ones and add events. + AlbumsL().VideosAddedOrRemovedFromCacheL( aId ); + AlbumsL().RemoveAlbumsL( aId ); #endif } @@ -470,9 +474,18 @@ iCache->AddVideosFromMdsL( aId, videoListFetchingWasCancelled, &nonVideoIds, EFalse /* dont update categories*/ ); - CategoriesL().ResetVideoCountersL(); - CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 ); - CategoriesL().UpdateCategoriesNewVideoNamesL(); + if ( aId.Count() ) + { + CategoriesL().ResetVideoCountersL(); + CategoriesL().UpdateCategoriesL( *iCache->iVideoList, 0 ); + CategoriesL().UpdateCategoriesNewVideoNamesL(); + +#ifdef VCX_ALBUMS + // Adds changed album indexes to Albums().iChangedAlbums. + // AlbumsL().UpdateChangedAlbumsL() will update the changed ones and add events. + AlbumsL().VideosAddedOrRemovedFromCacheL( aId ); +#endif + } #ifdef VCX_ALBUMS #if 0 //TODO: do this if we want to support albums which are being added by someone else than My Videos Collection @@ -480,6 +493,8 @@ //After the call nonVideoIds will contain only items which were actually added //to albums. AlbumsL().AddAlbumsFromMdsL( nonVideoIds ); +#else + nonVideoIds.Reset(); #endif #endif @@ -566,7 +581,7 @@ TMPXItemId( nonVideoIds[i], KVcxMvcMediaTypeAlbum ), aEvent ) ); } - iAlbums->UpdateChangedAlbumsL(); + AlbumsL().UpdateChangedAlbumsL(); #endif CleanupStack::PopAndDestroy( &nonVideoIds );