camerauis/cameraxui/cxengine/src/cxesysutil.cpp
changeset 21 fa6d9f75d6a6
parent 19 d9aefe59d544
child 29 699651f2666f
--- a/camerauis/cameraxui/cxengine/src/cxesysutil.cpp	Fri Apr 16 14:51:30 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxesysutil.cpp	Mon May 03 12:22:55 2010 +0300
@@ -137,20 +137,17 @@
 /*!
 * Return space available for Camera to use.
 * @param fs File Server session
+* @param index Index for the drive to be checked.
 * @param settings Camera settings instance
 * @return Amount of bytes free for Camera usage.
 */
-qint64 CxeSysUtil::spaceAvailable(RFs &fs, CxeSettings &settings)
+qint64 CxeSysUtil::spaceAvailable(RFs &fs, int index, CxeSettings &settings)
 {
     CX_DEBUG_ENTER_FUNCTION();
 
     qint64 freeSpace(0);
 
     try {
-        // Get drive index
-        int index(getCameraDrive(fs));
-        qt_symbian_throwIfError(index);
-
         // Get volume info
         TVolumeInfo volumeInfo;
         int status(fs.Volume(volumeInfo, index));
@@ -169,7 +166,7 @@
         settings.get(KCRUidDiskLevel.iUid, KDiskCriticalThreshold, Cxe::Repository, criticalThreshold);
 
         // Calculate space that we can still use. A small safety buffer is used above critical value.
-        freeSpace = std::max(volumeInfo.iFree - criticalThreshold.toInt() - KDiskSafetyLimit, (qint64)0);
+        freeSpace = std::max(qint64(0), volumeInfo.iFree - criticalThreshold.toInt() - KDiskSafetyLimit);
 
     } catch(const std::exception& e) {
         Q_UNUSED(e);