commonuis/CommonDialogs/src/caknmemoryselectionmodelmultidrive.cpp
branchRCL_3
changeset 25 941195f2d488
parent 18 0aa5fbdfbc30
child 55 aecbbf00d063
equal deleted inserted replaced
23:3d340a0166ff 25:941195f2d488
   301             {
   301             {
   302             // qtn.memc.remote.drive
   302             // qtn.memc.remote.drive
   303             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE;
   303             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE;
   304             break;
   304             break;
   305             }
   305             }
       
   306         case ETextUSBDefaultName:
       
   307             {
       
   308             // qtn.memc.usb.available.single.list
       
   309             resource = R_CFD_QTN_MEMC_USB_AVAILABLE_SINGLE_LIST;
       
   310             break;
       
   311             }
       
   312         case ETextUSBUnavailable:
       
   313             {
       
   314             // qtn.memc.usb.unavailable.single.list
       
   315             resource = R_CFD_QTN_MEMC_USB_UNAVAILABLE_SINGLE_LIST;
       
   316             break;
       
   317             }
   306         }
   318         }
   307     return resource;
   319     return resource;
   308     }
   320     }
   309 
   321 
   310 
   322 
   351             {
   363             {
   352             // TODO: To get real value from UI spec
   364             // TODO: To get real value from UI spec
   353             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE;
   365             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE;
   354             break;
   366             break;
   355             }
   367             }
       
   368         case ETextUSBDefaultName:
       
   369         case ETextUSBUnavailable:
       
   370             {
       
   371             // qtn.memc.usb.available.single.list
       
   372             resource = R_CFD_QTN_MEMC_USB_AVAILABLE_SINGLE_LIST;
       
   373             break;
       
   374             }
   356         }
   375         }
   357     return resource;
   376     return resource;
   358     }
   377     }
   359 
   378 
   360 
   379 
   378             {
   397             {
   379             // qtn.mem.mass.storage.double.list
   398             // qtn.mem.mass.storage.double.list
   380             resource = R_CFD_QTN_MEM_MASS_STORAGE_DOUBLE_LIST;
   399             resource = R_CFD_QTN_MEM_MASS_STORAGE_DOUBLE_LIST;
   381             break;
   400             break;
   382             }
   401             }
       
   402         case ETextMMCNamed:
       
   403             {
       
   404             // If MMC's name is given.
       
   405             // qtn.mem.named.memory.card.double
       
   406             resource = R_CFD_QTN_MEM_NAMED_MEMORY_CARD_DOUBLE;
       
   407             break;
       
   408             }
       
   409         case ETextMMCDefaultName:
       
   410             {
       
   411             // If MMC's name is empty.
       
   412             // qtn.mem.memory.card.default.double
       
   413             resource = R_CFD_QTN_MEM_MEMORY_CARD_DEFAULT_DOUBLE;
       
   414             break;
       
   415             }
       
   416         case ETextMMCLocked:
       
   417             {
       
   418             // qtn.memc.mmc.locked.double
       
   419             resource = R_CFD_QTN_MEMC_MMC_LOCKED_DOUBLE;
       
   420             break;
       
   421             }
       
   422         case ETextRemoteDrive:
       
   423             {
       
   424             // TODO: To be checked because of missing data in UI spec.
       
   425             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE_DOUBLE_LIST;
       
   426             break;
       
   427             }
       
   428         case ETextUSBDefaultName:
       
   429             {
       
   430             // qtn.memc.usb.available.double
       
   431             resource = R_CFD_QTN_MEMC_USB_AVAILABLE_DOUBLE;
       
   432             break;
       
   433             }
       
   434         case ETextMMCUnavailable:
       
   435         case ETextUSBUnavailable:
   383         case ETextInternalMassStorageUnavailable:
   436         case ETextInternalMassStorageUnavailable:
   384             {
   437             {
   385             // Unavailable:qtn.memc.mmc.unavailable.double
   438             // Unavailable:qtn.memc.mmc.unavailable.double
   386             // Only for second row
   439             // Only for second row
   387             resource = R_CFD_QTN_MEMC_MMC_UNAVAILABLE_DOUBLE;
   440             resource = R_CFD_QTN_MEMC_MMC_UNAVAILABLE_DOUBLE;
   388             break;
       
   389             }
       
   390         case ETextMMCNamed:
       
   391             {
       
   392             // If MMC's name is given.
       
   393             // qtn.mem.named.memory.card.double
       
   394             resource = R_CFD_QTN_MEM_NAMED_MEMORY_CARD_DOUBLE;
       
   395             break;
       
   396             }
       
   397         case ETextMMCDefaultName:
       
   398             {
       
   399             // If MMC's name is empty.
       
   400             // qtn.mem.memory.card.default.double
       
   401             resource = R_CFD_QTN_MEM_MEMORY_CARD_DEFAULT_DOUBLE;
       
   402             break;
       
   403             }
       
   404         case ETextMMCLocked:
       
   405             {
       
   406             // qtn.memc.mmc.locked.double
       
   407             resource = R_CFD_QTN_MEMC_MMC_LOCKED_DOUBLE;
       
   408             break;
       
   409             }
       
   410         case ETextMMCUnavailable:
       
   411             {
       
   412             // qtn.memc.mmc.unavailable.double
       
   413             resource = R_CFD_QTN_MEMC_MMC_UNAVAILABLE_DOUBLE;
       
   414             break;
       
   415             }
       
   416         case ETextRemoteDrive:
       
   417             {
       
   418             // TODO: To be checked because of missing data in UI spec.
       
   419             resource = R_CFD_QTN_MEMC_REMOTE_DRIVE_DOUBLE_LIST;
       
   420             break;
   441             break;
   421             }
   442             }
   422         }
   443         }
   423     return resource;
   444     return resource;
   424 
   445 
   957                     }
   978                     }
   958                 else
   979                 else
   959                     {
   980                     {
   960                     StringLoader::Format(
   981                     StringLoader::Format(
   961                         textString,
   982                         textString,
   962                         *iLocStringArray[ ETextInternalMassStorage ],
   983                         *iLocStringArray[ ETextUSBDefaultName ],
   963                         KNoIndex,
   984                         KNoIndex,
   964                         driveUnit.Name()
   985                         driveUnit.Name()
   965                         );
   986                         );
   966                     }
   987                     }
   967                 }
   988                 }
   968             else
   989             else
   969                 {
   990                 {
   970                 StringLoader::Format(
   991                 StringLoader::Format(
   971                     textString,
   992                     textString,
   972                     *iLocStringArray[ ETextInternalMassStorageUnavailable ],
   993                     *iLocStringArray[ ETextUSBUnavailable ],
   973                     KNoIndex,
   994                     KNoIndex,
   974                     driveUnit.Name()
   995                     driveUnit.Name()
   975                     );
   996                     );
   976                 }
   997                 }
   977             itemString.Append( textString );
   998             itemString.Append( textString );
   999                 }
  1020                 }
  1000             else
  1021             else
  1001                 {
  1022                 {
  1002                 StringLoader::Format(
  1023                 StringLoader::Format(
  1003                     itemString,
  1024                     itemString,
  1004                     *iLocStringArray[ ETextInternalMassStorage ],
  1025                     *iLocStringArray[ ETextUSBDefaultName ],
  1005                     KNoIndex,
  1026                     KNoIndex,
  1006                     driveUnit.Name()
  1027                     driveUnit.Name()
  1007                     );
  1028                     );
  1008                 }
  1029                 }
  1009             break;
  1030             break;
  1032             else
  1053             else
  1033                 {
  1054                 {
  1034                 // Use default drive description
  1055                 // Use default drive description
  1035                 StringLoader::Format(
  1056                 StringLoader::Format(
  1036                     textString,
  1057                     textString,
  1037                     *iLocStringArray[ ETextInternalMassStorage ],
  1058                     *iLocStringArray[ ETextUSBDefaultName ],
  1038                     KNoIndex,
  1059                     KNoIndex,
  1039                     driveUnit.Name()
  1060                     driveUnit.Name()
  1040                     );
  1061                     );
  1041                 }
  1062                 }
  1042             itemString.Append( textString );
  1063             itemString.Append( textString );
  1064                 CleanupStack::PopAndDestroy( buffer );
  1085                 CleanupStack::PopAndDestroy( buffer );
  1065                 }
  1086                 }
  1066             else
  1087             else
  1067                 {
  1088                 {
  1068                 itemString.Append(
  1089                 itemString.Append(
  1069                     *iLocStringArray[
  1090                     *iLocStringArray[ ETextUSBUnavailable ] );
  1070                         ETextInternalMassStorageUnavailable ] );
       
  1071                 }
  1091                 }
  1072             break;
  1092             break;
  1073             }
  1093             }
  1074         }
  1094         }
  1075 
  1095 
  1319             if ( driveExist )
  1339             if ( driveExist )
  1320                 {
  1340                 {
  1321                 driveNumber = TDriveNumber( i );
  1341                 driveNumber = TDriveNumber( i );
  1322                 rootPath.Zero();
  1342                 rootPath.Zero();
  1323                 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber );
  1343                 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber );
       
  1344                 if ( memoryType == AknCommonDialogsDynMem::EMemoryTypeMMCExternal &&
       
  1345                         ( iIncludedMedias & AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice ) )
       
  1346                     {
       
  1347                     // Hide usb memory
       
  1348                     TCFDDriveInfo info;
       
  1349                     AknCFDUtility::DriveInfoL( driveNumber, info );
       
  1350                     if ( info.iStatus & DriveInfo::EDriveUsbMemory )
       
  1351                         {
       
  1352                         continue;
       
  1353                         }
       
  1354                     else
       
  1355                         {
       
  1356                         memoryType = AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice;
       
  1357                         }
       
  1358                     }
  1324                 if( memoryType & iIncludedMedias )
  1359                 if( memoryType & iIncludedMedias )
  1325                     {
  1360                     {
  1326                     User::LeaveIfError(
  1361                     User::LeaveIfError(
  1327                     PathInfo::GetRootPath( rootPath, driveNumber ) );
  1362                     PathInfo::GetRootPath( rootPath, driveNumber ) );
  1328                     }
  1363                     }
  1366             TInt drive = driveList[i];
  1401             TInt drive = driveList[i];
  1367             driveNumber = TDriveNumber( i );
  1402             driveNumber = TDriveNumber( i );
  1368             if (drive)
  1403             if (drive)
  1369                 {
  1404                 {
  1370                 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber );
  1405                 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber );
       
  1406                 if ( memoryType == AknCommonDialogsDynMem::EMemoryTypeMMCExternal &&
       
  1407                         ( iIncludedMedias & AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice ) )
       
  1408                     {
       
  1409                     // Hide usb memory
       
  1410                     TCFDDriveInfo info;
       
  1411                     AknCFDUtility::DriveInfoL( driveNumber, info );
       
  1412                     if ( info.iStatus & DriveInfo::EDriveUsbMemory )
       
  1413                         {
       
  1414                         continue;
       
  1415                         }
       
  1416                     else
       
  1417                         {
       
  1418                         memoryType = AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice;
       
  1419                         }
       
  1420                     }
  1371                 if( memoryType & iIncludedMedias )
  1421                 if( memoryType & iIncludedMedias )
  1372                     {
  1422                     {
  1373                     User::LeaveIfError(
  1423                     User::LeaveIfError(
  1374                         PathInfo::GetRootPath( rootPath, driveNumber ) );
  1424                         PathInfo::GetRootPath( rootPath, driveNumber ) );
  1375                     driveArray->AppendL( rootPath );
  1425                     driveArray->AppendL( rootPath );