217 { |
217 { |
218 // Round trip suppport |
218 // Round trip suppport |
219 const CMTPStorageMetaData& storage( iFramework.StorageMgr().StorageL( iStorages[0] ) ); |
219 const CMTPStorageMetaData& storage( iFramework.StorageMgr().StorageL( iStorages[0] ) ); |
220 TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) ); |
220 TFileName root( storage.DesC( CMTPStorageMetaData::EStorageSuid ) ); |
221 GetModifiedContentL( root ); |
221 GetModifiedContentL( root ); |
222 iDataProvider.GetWrapperL().UpdateMusicCollectionL(); |
222 TRAPD( err, iDataProvider.GetWrapperL().UpdateMusicCollectionL() ); |
|
223 if ( err != KErrNone ) |
|
224 { |
|
225 PRINT1( _L("MM MTP <> ScanNextStorageL, UpdateMusicCollectionL err =%d "), err ); |
|
226 } |
223 |
227 |
224 iStorages.Remove( 0 ); |
228 iStorages.Remove( 0 ); |
225 ScanStorageL( iStorages[0] ); |
229 ScanStorageL( iStorages[0] ); |
226 } |
230 } |
227 else |
231 else |
417 // |
421 // |
418 // ----------------------------------------------------------------------------- |
422 // ----------------------------------------------------------------------------- |
419 // |
423 // |
420 TInt CMediaMtpDataProviderEnumerator::RunError( TInt aError ) |
424 TInt CMediaMtpDataProviderEnumerator::RunError( TInt aError ) |
421 { |
425 { |
422 PRINT1( _L( "MM MTP <> CMediaMtpDataProviderEnumerator::RunError with error %d" ), aError ); |
426 if ( aError != KErrNone ) |
|
427 PRINT1( _L( "MM MTP <> CMediaMtpDataProviderEnumerator::RunError with error %d" ), aError ); |
423 |
428 |
424 TRAP_IGNORE( SignalCompleteL( iDataProvider ) ); |
429 TRAP_IGNORE( SignalCompleteL( iDataProvider ) ); |
425 |
430 |
426 return KErrNone; |
431 return KErrNone; |
427 } |
432 } |
466 // |
471 // |
467 void CMediaMtpDataProviderEnumerator::ProcessEntriesL() |
472 void CMediaMtpDataProviderEnumerator::ProcessEntriesL() |
468 { |
473 { |
469 PRINT( _L( "MM MTP => CMediaMtpDataProviderEnumerator::ProcessEntriesL" ) ); |
474 PRINT( _L( "MM MTP => CMediaMtpDataProviderEnumerator::ProcessEntriesL" ) ); |
470 |
475 |
471 TBuf<KMaxFileName> path = iPath.DriveAndPath(); |
476 TFileName path = iPath.DriveAndPath(); |
472 |
477 |
473 while ( !IsOverThreshold() && iFirstUnprocessed < iEntries.Count() ) |
478 while ( !IsOverThreshold() && iFirstUnprocessed < iEntries.Count() ) |
474 { |
479 { |
475 const TEntry& entry = iEntries[iFirstUnprocessed]; |
480 const TEntry& entry = iEntries[iFirstUnprocessed]; |
476 path.Append( entry.iName ); |
|
477 PRINT1( _L( "MM MTP <> path = %S" ), &path ); |
|
478 |
481 |
479 TInt len = entry.iName.Length(); |
482 TInt len = entry.iName.Length(); |
480 |
483 |
481 if ( entry.IsDir() ) |
484 // Skip object with too long name |
482 { |
485 if ( KMaxFileName >= path.Length() + len ) |
483 path.Append( '\\' ); |
486 { |
484 ++len; |
487 path.Append( entry.iName ); |
485 |
488 PRINT1( _L( "MM MTP <> path = %S" ), &path ); |
486 // we don't need to process folder, just remember |
489 |
487 // the folder |
490 if ( entry.IsDir() ) |
488 TEntry* dirEntry = new TEntry( entry ); |
491 { |
489 User::LeaveIfNull( dirEntry ); |
492 path.Append( '\\' ); |
490 iDirStack.AppendL( dirEntry ); |
493 ++len; |
491 } |
494 |
492 else if ( IsFileAccepted( path ) ) |
495 // we don't need to process folder, just remember |
493 { |
496 // the folder |
494 AddEntryL( path ); |
497 TEntry* dirEntry = new TEntry( entry ); |
495 } |
498 User::LeaveIfNull( dirEntry ); |
496 |
499 iDirStack.AppendL( dirEntry ); |
497 // Remove filename part |
500 } |
498 path.SetLength( path.Length() - len ); |
501 else if ( IsFileAccepted( path ) ) |
|
502 { |
|
503 AddEntryL( path ); |
|
504 } |
|
505 |
|
506 // Remove filename part |
|
507 path.SetLength( path.Length() - len ); |
|
508 } |
499 |
509 |
500 iFirstUnprocessed++; |
510 iFirstUnprocessed++; |
501 } |
511 } |
502 |
512 |
503 StartEnumerationCount(); |
513 StartEnumerationCount(); |
617 PRINT( _L( "MM MTP => CMediaMtpDataProviderEnumerator::GetModifiedContentL" ) ); |
627 PRINT( _L( "MM MTP => CMediaMtpDataProviderEnumerator::GetModifiedContentL" ) ); |
618 TInt arrayCount = 0; |
628 TInt arrayCount = 0; |
619 CDesCArray* modifiedContents = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity ); |
629 CDesCArray* modifiedContents = new ( ELeave ) CDesCArrayFlat( KMTPDriveGranularity ); |
620 CleanupStack::PushL( modifiedContents ); // + modifiedContents |
630 CleanupStack::PushL( modifiedContents ); // + modifiedContents |
621 |
631 |
622 iDataProvider.GetWrapperL().GetModifiedContentL( aStorageRoot, arrayCount, *modifiedContents ); |
632 TRAPD( err, iDataProvider.GetWrapperL().GetModifiedContentL( aStorageRoot, arrayCount, *modifiedContents ) ); |
|
633 if ( err != KErrNone ) |
|
634 PRINT1( _L("MM MTP <> GetModifiedContentL err =%d "), err ); |
623 |
635 |
624 if ( arrayCount > 0 ) |
636 if ( arrayCount > 0 ) |
625 { |
637 { |
626 CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object |
638 CMTPObjectMetaData* object = CMTPObjectMetaData::NewLC(); // + object |
627 for ( TInt i = 0; i < arrayCount; i++ ) |
639 for ( TInt i = 0; i < arrayCount; i++ ) |