568 iDrive = EDriveZ; // Intialize iDrive to Z |
568 iDrive = EDriveZ; // Intialize iDrive to Z |
569 TInt filesize = iObexObject->Length(); |
569 TInt filesize = iObexObject->Length(); |
570 |
570 |
571 RFs rfs ; |
571 RFs rfs ; |
572 User::LeaveIfError(rfs.Connect()); |
572 User::LeaveIfError(rfs.Connect()); |
573 |
573 |
574 TFileName mmcRoot = PathInfo::MemoryCardRootPath(); // e.g. "E:\\" |
|
575 |
|
576 TInt mmcDrive = KDefaultDrive; // External memroy card |
574 TInt mmcDrive = KDefaultDrive; // External memroy card |
577 TInt imsDrive = KDefaultDrive; // Internal mass storage |
575 TInt imsDrive = KDefaultDrive; // Internal mass storage |
578 |
576 |
579 if ( mmcRoot == _L("E:\\")) |
577 User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultMassStorage, imsDrive)); |
580 { |
578 User::LeaveIfError(DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRemovableMassStorage, mmcDrive)); |
581 mmcDrive = EDriveE; |
579 |
582 imsDrive = EDriveF; |
580 TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL imsDrive=%d; mmcDrive=%d\t" ),imsDrive, mmcDrive ) ); |
583 } |
581 |
584 else if ( mmcRoot == _L("F:\\") ) |
|
585 { |
|
586 mmcDrive = EDriveF; |
|
587 imsDrive = EDriveE; |
|
588 } |
|
589 |
|
590 TVolumeInfo volumeInfo; |
582 TVolumeInfo volumeInfo; |
591 TInt err = rfs.Volume(volumeInfo, imsDrive); |
583 TInt err = rfs.Volume(volumeInfo, imsDrive); |
592 |
584 |
593 // If err != KErrNone, Drive is not available. |
585 // If err != KErrNone, Drive is not available. |
594 // |
586 // |
595 if ( !err ) |
587 if ( !err ) |
596 { |
588 { |
597 // Check capacity on Internal mass storage |
589 // Check capacity on Internal mass storage |
598 TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Internal mass storage E\t" )) ); |
590 TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Internal mass storage\t" )) ); |
599 if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, imsDrive ) ) |
591 if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, imsDrive ) ) |
600 { |
592 { |
601 iDrive = imsDrive; |
593 iDrive = imsDrive; |
602 } |
594 } |
603 } |
595 } |
605 { |
597 { |
606 err = rfs.Volume(volumeInfo, mmcDrive); |
598 err = rfs.Volume(volumeInfo, mmcDrive); |
607 if ( !err ) |
599 if ( !err ) |
608 { |
600 { |
609 // Check capacity on Internal mass storage |
601 // Check capacity on Internal mass storage |
610 TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Checking memory card F\t" )) ); |
602 TRACE_INFO( (_L( "[oppreceiveservice] CheckCapacityL Checking memory card\t" )) ); |
611 if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, mmcDrive ) ) |
603 if ( !SysUtil::DiskSpaceBelowCriticalLevelL( &rfs, filesize, mmcDrive ) ) |
612 { |
604 { |
613 iDrive = mmcDrive; |
605 iDrive = mmcDrive; |
614 } |
606 } |
615 } |
607 } |