394 Ignore the error, continue with the next one |
394 Ignore the error, continue with the next one |
395 */ |
395 */ |
396 TInt CMTPFSEnumerator::RunError(TInt aError) |
396 TInt CMTPFSEnumerator::RunError(TInt aError) |
397 { |
397 { |
398 __FLOG_VA((_L8("RunError - entry with error %d"), aError)); |
398 __FLOG_VA((_L8("RunError - entry with error %d"), aError)); |
399 if(!iFramework.StorageMgr().ValidStorageId(iStorages[iScanPos])) |
399 |
400 { |
400 // avoid to access overflow of iStorages |
401 __FLOG_VA((_L8("Invalid StorageID = %d"),iStorages[iScanPos] )); |
401 if (iScanPos < iStorages.Count()) |
402 if (iStorages.Count()>1) |
402 { |
403 { |
403 if(!iFramework.StorageMgr().ValidStorageId(iStorages[iScanPos])) |
404 //Not necessary to process any entry on the storage, since the storage removed. |
404 { |
405 //Then need to start from root dir of next storage if there is. |
405 __FLOG_VA((_L8("Invalid StorageID = %d"),iStorages[iScanPos] )); |
406 //So, the dir stack is popped to bottom. |
406 if (iStorages.Count()>1) |
407 iDirStack.Reset(); |
407 { |
408 } |
408 //Not necessary to process any entry on the storage, since the storage removed. |
409 iSkipCurrentStorage = ETrue; |
409 //Then need to start from root dir of next storage if there is. |
410 } |
410 //So, the dir stack is popped to bottom. |
|
411 iDirStack.Reset(); |
|
412 } |
|
413 iSkipCurrentStorage = ETrue; |
|
414 } |
|
415 } |
|
416 else |
|
417 { |
|
418 iSkipCurrentStorage = ETrue; |
|
419 } |
411 |
420 |
412 // Reschedule ourselves |
421 // Reschedule ourselves |
413 TRequestStatus* status = &iStatus; |
422 TRequestStatus* status = &iStatus; |
414 User::RequestComplete(status, aError); |
423 User::RequestComplete(status, aError); |
415 SetActive(); |
424 SetActive(); |
546 if ( mime != NULL ) |
555 if ( mime != NULL ) |
547 { |
556 { |
548 __FLOG_VA((_L("mime %S"), mime)); |
557 __FLOG_VA((_L("mime %S"), mime)); |
549 DpId = iDpSingletons.MTPUtility().GetDpIdL(parse.Ext().Mid(1),*mime); |
558 DpId = iDpSingletons.MTPUtility().GetDpIdL(parse.Ext().Mid(1),*mime); |
550 __FLOG_VA((_L("DpId find %d"), DpId)); |
559 __FLOG_VA((_L("DpId find %d"), DpId)); |
|
560 |
|
561 format = iDpSingletons.MTPUtility().GetFormatCodeByMimeTypeL(parse.Ext().Mid(1),*mime); |
|
562 AddFileEntryForOtherDpL(iCurrentPath, handle, format, DpId, entry, iStorages[iScanPos], |
|
563 iParentHandle, iDpSingletons.MTPUtility().GetSubFormatCodeL(parse.Ext().Mid(1),*mime)); |
551 } |
564 } |
552 format = iDpSingletons.MTPUtility().GetFormatCodeByMimeTypeL(parse.Ext().Mid(1),*mime); |
565 else |
553 AddFileEntryForOtherDpL(iCurrentPath, handle, format, DpId, entry, iStorages[iScanPos], |
566 { |
554 iParentHandle, iDpSingletons.MTPUtility().GetSubFormatCodeL(parse.Ext().Mid(1),*mime)); |
567 AddEntryL(iCurrentPath, handle, EMTPFormatCodeUndefined, iDpID, entry, iStorages[iScanPos], iParentHandle); |
|
568 } |
|
569 |
555 CleanupStack::PopAndDestroy(mime); |
570 CleanupStack::PopAndDestroy(mime); |
556 } |
571 } |
557 else |
572 else |
558 { |
573 { |
559 format = iDpSingletons.MTPUtility().GetFormatByExtension(parse.Ext().Mid(1)); |
574 format = iDpSingletons.MTPUtility().GetFormatByExtension(parse.Ext().Mid(1)); |