--- a/profilesservices/MediaFileList/Src/mediafiledialog.cpp Thu Jul 15 18:57:55 2010 +0300
+++ b/profilesservices/MediaFileList/Src/mediafiledialog.cpp Thu Aug 19 10:12:30 2010 +0300
@@ -1337,8 +1337,6 @@
// user has selected some media file
GetSelectedItemFileName( currentIndex, iBuf );
- TBool ret = ETrue;
-
// protection check not done when item is double checked
// if ( aAttr != EAttrDoubleClicked )
if (!ifilevalid)
@@ -2180,6 +2178,38 @@
iListBox->MakeVisible( ETrue );
}
+// ----------------------------------------------------------------------------
+// CMediaFileDialog::FilterInvalidFiles
+//
+// Filters the invalid files from media file handler
+// invalid files = rights expired DRM Protected files and no right files
+// ----------------------------------------------------------------------------
+//
+void CMediaFileDialog::FilterInvalidFiles()
+ {
+ TInt count = iMediaFileHandler->ResultCount();
+
+ for ( TInt idx = 0; idx < count; )
+ {
+ // check the validity
+ GetSelectedItemFileName( idx, iBuf );
+ if ( iProtectionHandler->IsFlieDRMExpired( iBuf ) )
+ {
+ // remove the item from handler in case of invalid file
+ iMediaFileHandler->Remove( idx );
+
+ // if an item was removed from handler, the idx will not
+ // be changed and the count will be decreased one. after
+ // recalculate the count, the next item will be checked in next loop.
+ count = iMediaFileHandler->ResultCount();
+ }
+ else
+ {
+ // just increase the idx in case of valid file
+ idx++;
+ }
+ }
+ }
// ----------------------------------------------------------------------------
// CMediaFileDialog::DoUpdateListBoxL
@@ -2189,6 +2219,8 @@
//
void CMediaFileDialog::DoUpdateListBoxL( TBool aRestFindBox )
{
+ // filter the invalid files to avoid showing in the list box
+ FilterInvalidFiles();
iState->SetUnknownFolderPosition( iMediaFileHandler->ResultCount() );
// check current item index in case media file database has changed