devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp
branchRCL_3
changeset 49 09b1ac925e3f
parent 16 9971b621ef6c
child 50 03674e5abf46
--- a/devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp	Thu Aug 19 10:45:23 2010 +0300
+++ b/devencdiskutils/DevEncCommonUtils/src/DevEncDiskUtils.cpp	Tue Aug 31 16:04:40 2010 +0300
@@ -255,23 +255,18 @@
     if (!err)
         return err;
     TInt64 memoryWarningSpace(0);
-    TRAP(err, memoryWarningSpace = FindWarningLevelTresholdL( aNumber ));
+    TRAP(err, memoryWarningSpace = FindWarningLevelTresholdL());
     if (!err)
         return err;
     
     DFLOG2( "CDevEncDiskUtils::DiskFinalize => memoryCriticalSpace = %d", (TInt) memoryCriticalSpace );
     DFLOG2( "CDevEncDiskUtils::DiskFinalize => memoryWarningSpace = %d", (TInt) memoryWarningSpace );
     
-    //create the number of files needed to fill the mmc or phone memory free space
+    //create the number of files needed to fill the mmc free space
     while( freeSpace )
         {
-        TInt64 newMemoryWarningSpace(0);
-        if( aNumber == EDriveC )
-        	{
-            // The real warning space is a percentage of the free space. This applies only on drive C. 
-            newMemoryWarningSpace = ( TInt64 ) ( volumeInfo.iSize*( 100 - memoryWarningSpace ) ) / 100;
-        	}
-        
+        /* The real warning space is a percentage of the free space */
+        TInt64 newMemoryWarningSpace = ( TInt64 ) ( volumeInfo.iSize*( 100 - memoryWarningSpace ) ) / 100;
         DFLOG2( "CDevEncDiskUtils::DiskFinalize => newMemoryWarningSpace = %d", (TInt) newMemoryWarningSpace );
 
         if( TInt64( volumeInfo.iFree ) > TInt64( KMaxInt ) )
@@ -280,14 +275,7 @@
             }
         else
         	{
-            if( aNumber == EDriveC )
-                {
-        	    size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - newMemoryWarningSpace );
-                }
-            else
-                {
-                size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - memoryWarningSpace );
-                }
+        	size = Max( 0LL, TInt64( volumeInfo.iFree ) - memoryCriticalSpace - newMemoryWarningSpace );
         	}
 
         TFileName temp;
@@ -314,19 +302,9 @@
         if( err )
             DFLOG2( "..fs.Volume fail %d", err );    
 
-        if( aNumber == EDriveC )
+        if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + newMemoryWarningSpace )
         	{
-            if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + newMemoryWarningSpace )
-        	    {
-                freeSpace = EFalse;
-                }
-            }
-        else
-            {
-            if( TInt64( volumeInfo.iFree ) <= memoryCriticalSpace + memoryWarningSpace )
-                {
-                freeSpace = EFalse;
-                }
+            freeSpace = EFalse;
             }
         }
 
@@ -370,16 +348,9 @@
 // CDevEncDiskUtils::FindWarningLevelTresholdL()
 // 
 // --------------------------------------------------------------------------
-TInt64 CDevEncDiskUtils::FindWarningLevelTresholdL( const TDriveNumber aNumber )
+TInt64 CDevEncDiskUtils::FindWarningLevelTresholdL()
 	{
-      if( aNumber == EDriveC )
-          {
-	      return (TInt64) FindValueL( KCRUidUiklaf, KUikOODDiskFreeSpaceWarningNoteLevel );
-          }
-      else
-          {
-          return (TInt64) FindValueL( KCRUidUiklaf, KUikOODDiskFreeSpaceWarningNoteLevelMassMemory );
-          }
+	return (TInt64) FindValueL( KCRUidUiklaf, /*KUikOODDiskWarningThreshold*/KUikOODDiskFreeSpaceWarningNoteLevel );
 	}
 
 // End of file