Index: sources/device/DeviceController.cpp =================================================================== diff -u -rc13fbc4bee3c690aa820eeb49d2d4470e79320d0 -reb918e27185e683e1d6a2b3ef0c621d173d561a5 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision c13fbc4bee3c690aa820eeb49d2d4470e79320d0) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision eb918e27185e683e1d6a2b3ef0c621d173d561a5) @@ -236,6 +236,10 @@ #ifdef BUILD_FOR_TARGET usbCheck(); sdcardSpaceCheck(); + + // The treatment logs are held in a separate partition from the unencrypted + // logs and need a separate disk space usage check + encryptedPartitionSpaceCheck(); #endif } @@ -276,7 +280,6 @@ qint64 mCTotal = 0; - // TODO We need to have an indicator in the export log whether it's SD or not. bool isMounted = FileHandler::isMounted(Storage::SDCard_Base_Path_Name); QString pathToCheckSpace = isMounted ? Storage::SDCard_Base_Path_Name : Storage::Standard_tmp; mCIsReady = driveSpaceCheck(pathToCheckSpace, mCTotal, mCAvailable, &mCIsReadOnly); @@ -363,7 +366,35 @@ // << mCAvailable ; } +/*! + * \brief DeviceController::encryptedPartitionSpaceCheck + * \details Checks the disk space of the encrypted partition + */ +void DeviceController::encryptedPartitionSpaceCheck() +{ + bool mCIsReady = false; + bool mCIsReadOnly = false; + qint64 mCTotal = 0; + qint64 mCAvailable = 0; + quint8 mPercent = 0; + mCIsReady = driveSpaceCheck(Storage::Encrypted_Partition_Path, mCTotal, mCAvailable, &mCIsReadOnly); +#if BUILD_FOR_DESKTOP + mCIsReady = true; // it is set to always true since on desktop a local folder is used for the encrypted folder which doesn't need (un)mount. +#endif + + if(!mCIsReady) qDebug()<<"NOT READY"; + + mPercent = mCTotal ? ((100 * mCAvailable) / mCTotal) : 0; + qDebug()<<"var percent "<< mPercent; + if (Log_Min_Available_Total_Space_IsLow(mPercent)) { + //DEBUG qDebug()<< (QString("Encrypted partition space lower than %1%").arg(Log_Min_Available_Total_Space_Percent)); + LOG_DEBUG(QString("Encrypted partition space lower than %1%").arg(Log_Min_Available_Total_Space_Percent)); + emit didEncryptedPartitionSpaceLow(); + } +} + + /*! * \brief DeviceController::usbError * \details Logs any error which has been happened