mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetstorageinfo.cpp
branchRCL_3
changeset 3 8b094906a049
parent 0 d0791faffa3f
child 4 60a94a45d437
equal deleted inserted replaced
2:4843bb5893b6 3:8b094906a049
   127 /**
   127 /**
   128 Populate the storage info data set
   128 Populate the storage info data set
   129 */	
   129 */	
   130 void CMTPGetStorageInfo::BuildStorageInfoL()
   130 void CMTPGetStorageInfo::BuildStorageInfoL()
   131 	{
   131 	{
       
   132 	iIsCDrive = EFalse;
   132 	SetupDriveVolumeInfoL();
   133 	SetupDriveVolumeInfoL();
   133     SetStorageTypeL();
   134     SetStorageTypeL();
   134     SetFileSystemTypeL();
   135     SetFileSystemTypeL();
   135     SetAccessCapabilityL();
   136     SetAccessCapabilityL();
   136     SetMaxCapacityL();
   137     SetMaxCapacityL();
   149 	TInt driveNo(iFramework.StorageMgr().DriveNumber(storageId));
   150 	TInt driveNo(iFramework.StorageMgr().DriveNumber(storageId));
   150 	User::LeaveIfError(driveNo);
   151 	User::LeaveIfError(driveNo);
   151 	RFs& fs = iFramework.Fs();
   152 	RFs& fs = iFramework.Fs();
   152 	User::LeaveIfError(fs.Drive(iDriveInfo, driveNo));
   153 	User::LeaveIfError(fs.Drive(iDriveInfo, driveNo));
   153 	User::LeaveIfError(fs.Volume(iVolumeInfo, driveNo));
   154 	User::LeaveIfError(fs.Volume(iVolumeInfo, driveNo));
       
   155 	
       
   156 	const TInt KCDriveNo = 2;
       
   157 	if(KCDriveNo == driveNo)
       
   158 		{
       
   159 		iDriveInfo.iType = EMediaRom;
       
   160 		iIsCDrive = ETrue;
       
   161 		}
   154 	}
   162 	}
   155 	
   163 	
   156 /**
   164 /**
   157 Set the storage type in the storage info data set
   165 Set the storage type in the storage info data set
   158 */
   166 */
   230 Set the free space of the drive in the storage info data set
   238 Set the free space of the drive in the storage info data set
   231 */
   239 */
   232 void CMTPGetStorageInfo::SetFreeSpaceInBytesL()
   240 void CMTPGetStorageInfo::SetFreeSpaceInBytesL()
   233 	{
   241 	{
   234 	TMTPTypeUint64 mtpFreeSpace(iVolumeInfo.iFree);
   242 	TMTPTypeUint64 mtpFreeSpace(iVolumeInfo.iFree);
       
   243 	if(iIsCDrive)
       
   244 		{
       
   245 		mtpFreeSpace.Set(0);
       
   246 		}
   235 	iStorageInfo->SetL(CMTPTypeStorageInfo::EFreeSpaceInBytes, mtpFreeSpace);	
   247 	iStorageInfo->SetL(CMTPTypeStorageInfo::EFreeSpaceInBytes, mtpFreeSpace);	
   236 	}
   248 	}
   237 	
   249 	
   238 /**
   250 /**
   239 Set the free space of in objects in the storage info data set
   251 Set the free space of in objects in the storage info data set