photosgallery/viewframework/uiutilities/src/glxmmcnotifier.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 13 bcb43dc84c44
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <glxtracer.h>
    19 #include <glxtracer.h>
    20 #include <glxlog.h>
    20 #include <glxlog.h>
    21 
    21 #include <driveinfo.h>
    22 #include "glxmmcnotifier.h"
    22 #include "glxmmcnotifier.h"
    23 
    23 
    24 // ---------------------------------------------------------
    24 // ---------------------------------------------------------
    25 // CGlxMMCNotifier::NewL
    25 // CGlxMMCNotifier::NewL
    26 // ---------------------------------------------------------
    26 // ---------------------------------------------------------
    90 void CGlxMMCNotifier::ConstructL()    
    90 void CGlxMMCNotifier::ConstructL()    
    91     {    
    91     {    
    92     TRACER("CGlxMMCNotifier::ConstructL()");
    92     TRACER("CGlxMMCNotifier::ConstructL()");
    93     TInt err = iFs.Connect();
    93     TInt err = iFs.Connect();
    94     GLX_LOG_INFO1("CGlxMMCNotifier::ConstructL iFs.Connect err %d",err );
    94     GLX_LOG_INFO1("CGlxMMCNotifier::ConstructL iFs.Connect err %d",err );
       
    95 
       
    96     User::LeaveIfError(DriveInfo::GetDefaultDrive(
       
    97             DriveInfo::EDefaultRemovableMassStorage, iDefaultMemoryCardDrive));
       
    98     GLX_LOG_INFO1("CGlxMMCNotifier::ConstructL iFs.Connect iDrive %d",
       
    99 			 iDefaultMemoryCardDrive );
    95     IssueRequest();
   100     IssueRequest();
    96     }
   101     }
    97 
   102 
    98 // ---------------------------------------------------------
   103 // ---------------------------------------------------------
    99 // CGlxMMCNotifier::DoCancel()
   104 // CGlxMMCNotifier::DoCancel()
   112 void CGlxMMCNotifier::RunL()    
   117 void CGlxMMCNotifier::RunL()    
   113     {    
   118     {    
   114     TRACER("CGlxMMCNotifier::RunL()");
   119     TRACER("CGlxMMCNotifier::RunL()");
   115     TDriveInfo driveInfo;
   120     TDriveInfo driveInfo;
   116     // Get the drive info for memory card     
   121     // Get the drive info for memory card     
   117     TInt err = iFs.Drive( driveInfo, EDriveF );
   122     TInt err = iFs.Drive(driveInfo, iDefaultMemoryCardDrive);
   118     GLX_LOG_INFO1("CGlxMMCNotifier::RunL err %d",err );
   123     GLX_LOG_INFO1("CGlxMMCNotifier::RunL driveInfo err=%d", err);
   119     if( err == KErrNone )      
   124     if (err == KErrNone && (driveInfo.iDriveAtt & KDriveAttRemovable))
   120         {      
   125         {
   121         switch( driveInfo.iType )        
   126         GLX_LOG_INFO1("CGlxMMCNotifier::RunL driveInfo.iDriveAtt=%d",
       
   127                 driveInfo.iDriveAtt);
       
   128         switch (driveInfo.iType)
   122             {        
   129             {        
   123             case EMediaNotPresent:          
   130             case EMediaNotPresent:          
   124                 {          
   131                 {          
   125                 //MMC removed  don't do anything   
   132                 //MMC removed  don't do anything   
   126                 iNotify.HandleMMCRemovalL();
   133                 iNotify.HandleMMCRemovalL();