codhandler/codeng/src/CodEngBase.cpp
changeset 27 6297cdf66332
parent 26 cb62a4f66ebe
child 34 220a17280356
equal deleted inserted replaced
26:cb62a4f66ebe 27:6297cdf66332
   480 // CCodEngBase::RemovableMedia()
   480 // CCodEngBase::RemovableMedia()
   481 // ---------------------------------------------------------
   481 // ---------------------------------------------------------
   482 //
   482 //
   483 EXPORT_C TBool CCodEngBase::RemovableMedia() const
   483 EXPORT_C TBool CCodEngBase::RemovableMedia() const
   484     {
   484     {
   485     return iRemovableMedia;
   485     return ( KDriveAttRemovable == iRemovableMediaStatus ) ? ETrue : EFalse ;
   486     }
   486     }
   487 
   487 
   488 // ---------------------------------------------------------
   488 // ---------------------------------------------------------
   489 // CCodEngBase::GetPath()
   489 // CCodEngBase::GetPath()
   490 // ---------------------------------------------------------
   490 // ---------------------------------------------------------
   578   iAvailDriveSpace( -1 ),
   578   iAvailDriveSpace( -1 ),
   579 #else
   579 #else
   580   iPhoneMemoryOk( EFalse ),
   580   iPhoneMemoryOk( EFalse ),
   581   iMmcOk( EFalse ),
   581   iMmcOk( EFalse ),
   582 #endif
   582 #endif
   583   iRemovableMedia( EFalse ),
   583   iRemovableMediaStatus( KDriveAttLocal ),
   584   iStatusCode( KHttp902UserCancelled ),
   584   iStatusCode( KHttp902UserCancelled ),
   585   iResult( KErrGeneral ),
   585   iResult( KErrGeneral ),
   586   iContentTypeCheck ( EFalse ),
   586   iContentTypeCheck ( EFalse ),
   587   iResumedDownload ( EFalse )  
   587   iResumedDownload ( EFalse )  
   588     {
   588     {
  2006                     &KTempFilesCodDirName );      
  2006                     &KTempFilesCodDirName );      
  2007 
  2007 
  2008     (*iData)[iData->ActiveDownload()]->iTempPath.Append(rootPath.Drive());
  2008     (*iData)[iData->ActiveDownload()]->iTempPath.Append(rootPath.Drive());
  2009     (*iData)[iData->ActiveDownload()]->iTempPath.Append(tempBuf);
  2009     (*iData)[iData->ActiveDownload()]->iTempPath.Append(tempBuf);
  2010 
  2010 
       
  2011 
       
  2012     TDriveUnit unit( rootPath.Drive() );
       
  2013 
       
  2014 #ifdef RD_MULTIPLE_DRIVE    
       
  2015     TUint aStatus ;
       
  2016     
       
  2017     if( KErrNone == DriveInfo::GetDriveStatus( iFs, unit , aStatus ))
       
  2018             {
       
  2019             iRemovableMediaStatus = (aStatus & DriveInfo::EDriveExternallyMountable) ? aStatus : 0 ;
       
  2020             if( iRemovableMediaStatus )
       
  2021                 {
       
  2022                 iRemovableMediaStatus = (aStatus & DriveInfo::EDriveRemovable) ? KDriveAttRemovable : KDriveAttInternal ;				
       
  2023                 }
       
  2024             else
       
  2025                 {
       
  2026                 iRemovableMediaStatus = KDriveAttLocal ;
       
  2027                 }
       
  2028             }    	
       
  2029 #else
  2011     TDriveInfo info;
  2030     TDriveInfo info;
  2012     TDriveUnit unit( rootPath.Drive() );
  2031     User::LeaveIfError( iFs.Drive( info, unit ) );	
  2013     User::LeaveIfError( iFs.Drive( info, unit ) );
  2032     if ( info.iDriveAtt & KDriveAttRemovable )
       
  2033         {
       
  2034         iRemovableMediaStatus = KDriveAttRemovable;
       
  2035         }
       
  2036     else
       
  2037         {
       
  2038         iRemovableMediaStatus = KDriveAttLocal;
       
  2039         }
       
  2040 #endif
  2014     // Create the temp directory earlier in case it's not created yet
  2041     // Create the temp directory earlier in case it's not created yet
  2015     iFs.MkDirAll( (*iData)[iData->ActiveDownload()]->iTempPath ); 
  2042     iFs.MkDirAll( (*iData)[iData->ActiveDownload()]->iTempPath );
  2016     if ( info.iDriveAtt & KDriveAttRemovable )
  2043     
  2017         {
       
  2018         iRemovableMedia = ETrue;
       
  2019         }
       
  2020         
       
  2021     CLOG(( ECodEng, 2, _L("<- CCodEngBase::SetPathsL root<%S> temp<%S>"), \
  2044     CLOG(( ECodEng, 2, _L("<- CCodEngBase::SetPathsL root<%S> temp<%S>"), \
  2022         &(*iData)[iData->ActiveDownload()]->iRootPath, &(*iData)[iData->ActiveDownload()]->iTempPath ));
  2045         &(*iData)[iData->ActiveDownload()]->iRootPath, &(*iData)[iData->ActiveDownload()]->iTempPath ));
  2023     }
  2046     }
  2024 
  2047 
  2025 // ---------------------------------------------------------
  2048 // ---------------------------------------------------------
  2036     iPhoneMemoryOk = EFalse;
  2059     iPhoneMemoryOk = EFalse;
  2037     iMmcOk = EFalse;
  2060     iMmcOk = EFalse;
  2038 #endif
  2061 #endif
  2039     //(*iData)[iData->ActiveDownload()]->iTempPath = KNullDesC;
  2062     //(*iData)[iData->ActiveDownload()]->iTempPath = KNullDesC;
  2040     //(*iData)[iData->ActiveDownload()]->iRootPath = KNullDesC;
  2063     //(*iData)[iData->ActiveDownload()]->iRootPath = KNullDesC;
  2041     iRemovableMedia = EFalse;
  2064 
       
  2065     iRemovableMediaStatus = KDriveAttLocal;
  2042     }
  2066     }
  2043 
  2067 
  2044 #ifdef RD_MULTIPLE_DRIVE
  2068 #ifdef RD_MULTIPLE_DRIVE
  2045 //------------------------------------------------------------------------
  2069 //------------------------------------------------------------------------
  2046 //CCodEngBase::QueryDynDriveListLC
  2070 //CCodEngBase::QueryDynDriveListLC