diff -r 67eb01668b0e -r baf439b22ddd videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Wed Jun 09 09:44:23 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosalbum.cpp Mon Jun 21 15:43:03 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; }