diff -r f6d44a0cd476 -r 13331705e488 videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Fri May 28 09:45:19 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Fri Jun 11 09:44:20 2010 +0300 @@ -292,7 +292,7 @@ // CVcxMyVideosAlbum::CalculateAttributesL // --------------------------------------------------------------------------- // -void CVcxMyVideosAlbum::CalculateAttributesL( TInt aStartIndex ) +TBool CVcxMyVideosAlbum::CalculateAttributesL() { TInt videoCount = 0; TUint32 count = iVideoList.Count(); @@ -303,7 +303,7 @@ TUint32 flags; TInt64 currentItemsCreationDate = 0; TInt64 latestCreationDate = TVcxMyVideosCollectionUtil::CreationDateL( *iMedia ); - for ( TInt i = aStartIndex; i < count; i++ ) + for ( TInt i = 0; i < count; i++ ) { video = iCollection.iCache->FindVideoByMdsIdL( iVideoList[i].iMdsId, pos ); if ( video ) @@ -322,13 +322,36 @@ } } } - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, videoCount ); - iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, newCount ); + + TBool modified = EFalse; + + TUint32 prevValue = TVcxMyVideosCollectionUtil::CategoryItemCountL( *iMedia ); + if ( prevValue != videoCount ) + { + iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryItemCount, videoCount ); + modified = ETrue; + } + + prevValue = TVcxMyVideosCollectionUtil::CategoryNewItemCountL( *iMedia ); + if ( prevValue != newCount ) + { + iMedia->SetTObjectValueL( KVcxMediaMyVideosCategoryNewItemCount, newCount ); + modified = ETrue; + } + if ( latestNewVideo ) { - iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName, - TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) ); + TPtrC prevNewVideoName( TVcxMyVideosCollectionUtil::CategoryNewVideoName( *iMedia ) ); + TPtrC latestNewVideoName( TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) ); + if ( prevNewVideoName != latestNewVideoName ) + { + iMedia->SetTextValueL( KVcxMediaMyVideosCategoryNewItemName, + TVcxMyVideosCollectionUtil::Title( *latestNewVideo ) ); + iMedia->SetTObjectValueL( KMPXMediaGeneralDate, latestCreationDate ); + modified = ETrue; + } } - iMedia->SetTObjectValueL( KMPXMediaGeneralDate, latestCreationDate ); + + return modified; }