localconnectivityservice/obexreceiveservices/opp/src/oppcontroller.cpp
changeset 32 51f207bebb06
parent 28 ec1b007b6296
child 20 2553637c2525
child 33 0b722902461e
equal deleted inserted replaced
31:3b92f7acdc91 32:51f207bebb06
    29 #include    <btengdomaincrkeys.h>
    29 #include    <btengdomaincrkeys.h>
    30 #include    <AiwServiceHandler.h> // The AIW service handler
    30 #include    <AiwServiceHandler.h> // The AIW service handler
    31 #include    <sysutil.h>
    31 #include    <sysutil.h>
    32 #include    <btengdomaincrkeys.h> 
    32 #include    <btengdomaincrkeys.h> 
    33 #include    <msvids.h>
    33 #include    <msvids.h>
    34 #include    <pathinfo.h>          // provides interface for quering system paths 
    34 #include    <DriveInfo.h> 
    35 #include    <es_sock.h>
    35 #include    <es_sock.h>
    36 #include    <bt_sock.h>
    36 #include    <bt_sock.h>
    37 
    37 
    38 // CONSTANTS
    38 // CONSTANTS
    39 
    39 
   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             }