Index: sources/storage/DriveWatcher.cpp =================================================================== diff -u -r6cad9b004e904200b71de7431c745795256080df -ra3030123e885fb9f22dea5839c4e988896a257e4 --- sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision 6cad9b004e904200b71de7431c745795256080df) +++ sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision a3030123e885fb9f22dea5839c4e988896a257e4) @@ -85,6 +85,14 @@ } // coco end +void DriveWatcher::onRemoveLogs(bool vInProgress) +{ + // coco begin validated: The log in progress requires user interaction + // it has been tested and works fine in normal run. + _pauseSpaceCheck = vInProgress; +} +// coco end + /*! * \brief DriveWatcher::initConnections * \details Initializes the required signal/slot connection between this class and other objects @@ -94,6 +102,8 @@ { connect(&_ApplicationController, SIGNAL(didUSBDriveUmount()), this , SLOT( onUSBDriveUmount())); + connect(&_Logger , SIGNAL(didRemoveLogs(bool)), + this , SLOT( onRemoveLogs(bool))); } /*! @@ -238,18 +248,27 @@ } if (! mCIsReady ) { - mOIsReady = mCIsReady; + mOIsReady = mCIsReady; + mOTotal = 0; + mOAvailable = 0; return; } quint8 mPercent = mCTotal ? ((100 * mCAvailable) / mCTotal) : 0; + if (mPercent < _minRequiredAvailableSpacePercent) { + LOG_EVENT(QString("SD-CARD space lower than %1%").arg(_minRequiredAvailableSpacePercent)); + emit didSDCardSpaceTooLow(_minRequiredAvailableSpacePercent); + } + if (mOTotal == mCTotal && - mOAvailable == mCAvailable && - mPercent >= _minRequiredAvailableSpacePercent ) return; + mOAvailable == mCAvailable) { + return; + } mOIsReady = mCIsReady ; mOTotal = mCTotal ; mOAvailable = mCAvailable ; + if (_pauseSpaceCheck) return; emit didSDCardSpaceChange(mCIsReady, mCTotal, mCAvailable, mPercent); } // coco end @@ -303,7 +322,7 @@ * \brief DriveWatcher::usbMount * \details Mounts the USB device vDevice * \note Emits didUSBDriveMount signal - * \param vDevice - USB device to be mounted (eg. /dev/sda1) + * \param vDevice - USB device to be mounted (e.g. /dev/sda1) * \return true on successful mount */ bool DriveWatcher::usbMount(const QString &vDevice) @@ -329,7 +348,7 @@ * \brief DriveWatcher::usbUmount * \details Unmounts the USB device vDevice * \note Emits didUSBDriveUmount signal - * \param vDevice - USB device to be unmounted (eg. /dev/sda1) + * \param vDevice - USB device to be unmounted (e.g. /dev/sda1) * \return true on successful unmount */ bool DriveWatcher::usbUmount(const QString &vDevice)