commonuis/CommonDialogs/src/caknmemoryselectionmodelmultidrive.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 4 8ca85d2f0db7
child 25 941195f2d488
--- a/commonuis/CommonDialogs/src/caknmemoryselectionmodelmultidrive.cpp	Wed Apr 14 16:14:00 2010 +0300
+++ b/commonuis/CommonDialogs/src/caknmemoryselectionmodelmultidrive.cpp	Tue Apr 27 16:55:05 2010 +0300
@@ -457,9 +457,8 @@
         else
         	{
         	AddMMCItemToLbxL( aDriveInfo );
+        	iHasMMCUnavailable = ( aDriveInfo.iDriveStatus == EDriveNotReady );
         	}
-
-        iHasMMCUnavailable = ( aDriveInfo.iDriveStatus == EDriveNotReady );
         }
     else if ( ( aDriveInfo.iStatus & DriveInfo::EDriveRemote )
         && ( aDriveInfo.iMediaType == EMediaRemote ) )
@@ -939,55 +938,38 @@
             itemString.Append( KTabChar );
 
             // 1st row text:
-            if( ( aDriveInfo.iDriveStatus == EDriveOK ) &&
-                ( aDriveInfo.iVolumeLabel.Length() > 0 ) )
-                {
-                StringLoader::Format(
-                    textString2,
-                    *iLocStringArray[ ETextMMCNamed ],
-                    KIndexFirst,
-                    driveUnit.Name()
-                    );
-                StringLoader::Format(
-                    textString,
-                    textString2,
-                    KIndexSecond,
-                    aDriveInfo.iVolumeLabel
-                    );
-                }
-            else if ( aDriveInfo.iDriveStatus == EDriveNotReady )
+            if( aDriveInfo.iDriveStatus == EDriveOK )
                 {
-                //textString.Format(
-                //    *iLocStringArray[ ETextMMCUnavailable ],
-                //    driveUnit.Name() );
-                StringLoader::Format(
-                    textString,
-                    *iLocStringArray[ ETextMMCUnavailable ],
-                    KNoIndex,
-                    driveUnit.Name()
-                    );
-                }
-            else if( aDriveInfo.iDriveStatus == EDriveLocked )
-                {
-                //textString.Format(
-                //    *iLocStringArray[ ETextMMCLocked ],
-                //    driveUnit.Name() );
-                StringLoader::Format(
-                    textString,
-                    *iLocStringArray[ ETextMMCLocked ],
-                    KNoIndex,
-                    driveUnit.Name()
-                    );
+                if( aDriveInfo.iVolumeLabel.Length() > 0 )
+                    {
+                    StringLoader::Format(
+                        textString2,
+                        *iLocStringArray[ ETextMMCNamed ],
+                        KIndexFirst,
+                        driveUnit.Name()
+                        );
+                    StringLoader::Format(
+                        textString,
+                        textString2,
+                        KIndexSecond,
+                        aDriveInfo.iVolumeLabel
+                        );
+                    }
+                else
+                    {
+                    StringLoader::Format(
+                        textString,
+                        *iLocStringArray[ ETextInternalMassStorage ],
+                        KNoIndex,
+                        driveUnit.Name()
+                        );
+                    }
                 }
             else
                 {
-                // Use default drive description
-                //textString.Format(
-                //    *iLocStringArray[ ETextMMCDefaultName ],
-                //    driveUnit.Name() );
                 StringLoader::Format(
                     textString,
-                    *iLocStringArray[ ETextMMCDefaultName ],
+                    *iLocStringArray[ ETextInternalMassStorageUnavailable ],
                     KNoIndex,
                     driveUnit.Name()
                     );
@@ -1002,11 +984,6 @@
             if( aDriveInfo.iVolumeLabel.Length() > 0 )
                 {
                 // Append drive name if it has one
-                //itemString.Format(
-                //    *iLocStringArray[ ETextMMCNamed ],
-                //    driveUnit.Name(),
-                //    aDriveInfo.iVolumeLabel
-                //    );
                 StringLoader::Format(
                     textString,
                     *iLocStringArray[ ETextMMCNamed ],
@@ -1022,13 +999,9 @@
                 }
             else
                 {
-                //itemString.Format(
-                //    *iLocStringArray[ ETextMMCDefaultName ],
-                //    driveUnit.Name()
-                //    );
                 StringLoader::Format(
                     itemString,
-                    *iLocStringArray[ ETextMMCDefaultName ],
+                    *iLocStringArray[ ETextInternalMassStorage ],
                     KNoIndex,
                     driveUnit.Name()
                     );
@@ -1059,13 +1032,9 @@
             else
                 {
                 // Use default drive description
-                //textString.Format(
-                //    *iLocStringArray[ ETextMMCDefaultName ],
-                //    driveUnit.Name()
-                //   );
                 StringLoader::Format(
                     textString,
-                    *iLocStringArray[ ETextMMCDefaultName ],
+                    *iLocStringArray[ ETextInternalMassStorage ],
                     KNoIndex,
                     driveUnit.Name()
                     );
@@ -1074,41 +1043,31 @@
             itemString.Append( KTabChar );
 
             // 2nd row text:
-            switch( aDriveInfo.iDriveStatus )
+            if ( aDriveInfo.iDriveStatus == EDriveOK )
                 {
-                case EDriveNotReady:
+                HBufC* buffer;
+                TInt64 freeSpace = aDriveInfo.iDiskSpace;
+                if ( freeSpace >= 0 )
                     {
-                    itemString.Append(
-                        *iLocStringArray[ ETextMMCUnavailable ] );
-                    break;
+                    buffer = HBufC::NewLC( KListBoxEntryMaxLength );  
+                    TPtr unitStr( buffer->Des() );
+                    AknCFDUtility::SetSecondRowTextL( freeSpace, unitStr );
                     }
-                case EDriveLocked:
-                    {
-                    itemString.Append( *iLocStringArray[ ETextMMCLocked ] );
-                    break;
-                    }
-                case EDriveOK:
-                default:
+                else
                     {
-                    HBufC* buffer;
-                    TInt64 freeSpace = aDriveInfo.iDiskSpace;
-                    if ( freeSpace >= 0 )
-                        {
-                        buffer = HBufC::NewLC( KListBoxEntryMaxLength );  
-                        TPtr unitStr( buffer->Des() );
-                        AknCFDUtility::SetSecondRowTextL( freeSpace, unitStr );
-                        }
-                    else
-                        {
-                        // Disk space is unavailable
-                        buffer = StringLoader::LoadLC(
-                                    R_CFD_QTN_MEMC_SPACE_NOT_AVAILABLE,
-                                    iCoeEnv);
-                        }
-                    itemString.Append( *buffer );//Free mem text
-                    CleanupStack::PopAndDestroy( buffer );
-                    break;
+                    // Disk space is unavailable
+                    buffer = StringLoader::LoadLC(
+                                R_CFD_QTN_MEMC_SPACE_NOT_AVAILABLE,
+                                iCoeEnv);
                     }
+                itemString.Append( *buffer );//Free mem text
+                CleanupStack::PopAndDestroy( buffer );
+                }
+            else
+                {
+                itemString.Append(
+                    *iLocStringArray[
+                        ETextInternalMassStorageUnavailable ] );
                 }
             break;
             }