--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Tue Apr 27 17:09:22 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadataaccesswrapper.cpp Tue May 11 16:40:32 2010 +0300
@@ -291,21 +291,6 @@
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::DeleteObjectL" ) );
}
-// ---------------------------------------------------------------------------
-// CMmMtpDpMetadataAccessWrapper::SetStorageRootL
-// Sets current Drive info
-// ---------------------------------------------------------------------------
-//
-void CMmMtpDpMetadataAccessWrapper::SetStorageRootL( const TDesC& aStorageRoot )
- {
- PRINT( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::SetStorageRootL" ) );
-
- iMmMtpDpMetadataVideoAccess->SetStorageRootL( aStorageRoot );
- iMmMtpDpMetadataMpxAccess->SetStorageRootL( aStorageRoot );
-
- PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::SetStorageRootL" ) );
- }
-
// -----------------------------------------------------------------------------
// CMmMtpDpMetadataMpxAccess::SetImageObjPropL
// set image specific properties specific to videos
@@ -583,8 +568,6 @@
//
TBool CMmMtpDpMetadataAccessWrapper::IsExistL( const TDesC& aSuid )
{
- TParsePtrC parse( aSuid );
- iMmMtpDpMetadataMpxAccess->SetStorageRootL( parse.Drive() );
return iMmMtpDpMetadataMpxAccess->IsExistL( aSuid );
}
@@ -627,26 +610,22 @@
{
PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::CreateDummyFile, filename = %S" ), &aPlaylistName );
- if ( MmMtpDpUtility::FormatFromFilename( aPlaylistName ) ==
- EMTPFormatCodeAbstractAudioVideoPlaylist )
+ RFile newfile;
+ TInt err = newfile.Replace( iFs, aPlaylistName, EFileWrite );
+
+ if ( err != KErrNone )
{
- RFile newfile;
- TInt err = newfile.Replace( iFs, aPlaylistName, EFileWrite );
-
+ newfile.Close();
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CreateDummyFile err = %d" ), err );
+ }
+ else // File created OK
+ {
+ err = newfile.Flush();
+ newfile.Close();
+ err = iFs.SetAtt( aPlaylistName, KEntryAttSystem | KEntryAttHidden,
+ KEntryAttReadOnly | KEntryAttNormal );
if ( err != KErrNone )
- {
- newfile.Close();
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CreateDummyFile err = %d" ), err );
- }
- else // File created OK
- {
- err = newfile.Flush();
- newfile.Close();
- err = iFs.SetAtt( aPlaylistName, KEntryAttSystem | KEntryAttHidden,
- KEntryAttReadOnly | KEntryAttNormal );
- if ( err != KErrNone )
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CreateDummyFile Dummy Playlist file created. err = %d" ), err );
- }
+ PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CreateDummyFile Dummy Playlist file created. err = %d" ), err );
}
}
@@ -685,7 +664,7 @@
PRINT3( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile filename = %S, err %d, entry.iSize = %d" ),
&fileName, err, entry.iSize );
}
- else if ( format != EMTPFormatCodeM3UPlaylist )
+ else
{
TInt err = iFs.Delete( fileName );
@@ -693,11 +672,6 @@
&fileName,
err );
}
- else
- {
- // leave the Imported playlist in the file system
- PRINT1( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::RemoveDummyFile, Don't delete m3u file [%S]" ), &fileName );
- }
}
PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::RemoveDummyFiles" ) );
}
@@ -707,8 +681,9 @@
// Update Music collection
// ---------------------------------------------------------------------------
//
-EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL()
+EXPORT_C void CMmMtpDpMetadataAccessWrapper::UpdateMusicCollectionL( const TDesC& aStorageRoot )
{
+ iMmMtpDpMetadataMpxAccess->SetStorageRootL( aStorageRoot );
iMmMtpDpMetadataMpxAccess->UpdateMusicCollectionL( );
}