harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp
changeset 41 2290317b9ec5
parent 21 50bf9db68373
equal deleted inserted replaced
23:33ae025ac1e8 41:2290317b9ec5
   111 	TBool presentState( EFalse );
   111 	TBool presentState( EFalse );
   112     
   112     
   113 	TUint32 hdMediaId( 0 );
   113 	TUint32 hdMediaId( 0 );
   114     hdMediaId = iMountTask->GetInternalDriveMediaId();
   114     hdMediaId = iMountTask->GetInternalDriveMediaId();
   115     
   115     
   116     const TInt count( medias.Count() );
   116     for( TInt i = medias.Count() - 1; i >=0; i-- )
   117     for ( TInt i = 0; i < count; i++ )
       
   118     	{
   117     	{
   119     	TRAP_IGNORE( iMdEClient->GetMediaL( medias[i].iMediaId, driveLetter, presentState ) );
   118     	TRAP_IGNORE( iMdEClient->GetMediaL( medias[i].iMediaId, driveLetter, presentState ) );
   120     	
   119     	
   121     	if ( presentState && medias[i].iMediaId != hdMediaId )
   120     	if ( presentState && medias[i].iMediaId != hdMediaId )
   122     		{
   121     		{
   263             	{
   262             	{
   264 	            WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EDismounted" );
   263 	            WRITELOG( "CMMCMonitorPlugin::MountEvent with parameter EDismounted" );
   265 	            mountData->iMountType = TMountData::EUnmount;
   264 	            mountData->iMountType = TMountData::EUnmount;
   266 	            iMountTask->StartUnmount( *mountData );
   265 	            iMountTask->StartUnmount( *mountData );
   267             	}
   266             	}
       
   267             else
       
   268                 {
       
   269                 delete mountData;
       
   270                 mountData = NULL;
       
   271                 }
   268             }
   272             }
   269         break;
   273         break;
   270         
   274         
   271         case EFormatted:
   275         case EFormatted:
   272             {
   276             {
   342                 driveList[i] = 0;
   346                 driveList[i] = 0;
   343                 continue;
   347                 continue;
   344                 }
   348                 }
   345             
   349             
   346             iFs.Drive( driveInfo, i );
   350             iFs.Drive( driveInfo, i );
   347             if ( ((driveInfo.iDriveAtt & KDriveAttRemovable) || (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) ||
   351             if( ( (driveStatus & DriveInfo::EDriveRemovable) ||
   348                    (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ) &&
   352                    (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ||
   349                    (driveInfo.iType != EMediaNotPresent) )
   353                    (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) ||
       
   354                    (driveInfo.iDriveAtt & KDriveAttRemovable) ) &&
       
   355                 (driveInfo.iType != EMediaNotPresent) )
   350                 {
   356                 {
   351                 count++; // DEBUG INFO
   357                 count++; // DEBUG INFO
   352                 
   358                 
   353                 iFs.DriveToChar( i, drive );
   359                 iFs.DriveToChar( i, drive );
   354                 
   360