Index: sources/storage/Logger.cpp =================================================================== diff -u -r75e10e5c2ada62906baded5ba8731977e51b1357 -rc2ed4667b513c51c5ee31566c15d2cf5a042ed61 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 75e10e5c2ada62906baded5ba8731977e51b1357) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision c2ed4667b513c51c5ee31566c15d2cf5a042ed61) @@ -260,8 +260,8 @@ /*! * \brief Logger::onCryptSetupMount - * \details the handlet for the _DeviceController::didCryptSetupMount - * to set the treatment fodler when the encrypted parttion is ready + * \details the handler for the _DeviceController::didCryptSetupMount + * to set the treatment folder when the encrypted partition is ready * and successfully decrypted and mounted. * It checks to make sure the folder exist and is able to be written and read. */ @@ -272,10 +272,10 @@ // use the Settings path first (/var/configurations (Encrypted Partition)) if ( ! QDir (basePath ).exists( )) { basePath = Storage::Standard_tmp; goto lOut; } - if ( ! FileHandler::makeFolder (basePath + Storage::Log_Folder_Treatment )) { basePath = Storage::Standard_tmp; goto lOut; } + if ( ! FileHandler::makeFolder (basePath + Storage::Txr_Folder_Treatment )) { basePath = Storage::Standard_tmp; goto lOut; } lOut: - _logPathNames[vLogType] = basePath + Storage::Log_Folder_Treatment; + _logPathNames[vLogType] = basePath + Storage::Txr_Folder_Treatment; emit didLogPathSet(vLogType, _logPathNames[vLogType]); FileHandler::errOut(tr("The '%1' folder selected for the treatment reports").arg(_logPathNames[vLogType])); @@ -491,13 +491,16 @@ * \details Remove old logs by iterating in the log/service folders and look for expired logs. * \return count file(s) have been removed. */ -int Logger::removeLogs() +int Logger::removeLogs(LogType vLogType) { // Storage::FileHandler::find("/media/denali/0CAA-40C1/log/", {"*.err"}, 15); return 0; // has been tested manually LOG_DEBUG(tr("Initializing log clean up")); int removeCount = 0; - for ( const auto &iType : { eLogAppED , eLogDebug , eLogTrtmt } ) { + auto logTypes = { eLogAppED , eLogDebug , eLogCloud , eLogTrtmt }; + auto logType = { vLogType }; + + for ( const auto &iType : ( vLogType == eLogAll ? logTypes : logType ) ) { QString mCSource = _logPathNames [iType]; QString mCExtension = _logFileNameExt[iType]; // DEBUG: qDebug() << "@" << mCSource << mLogFileFilter << mCExtension << iType << _logTypeMaxUsageLimit[iType]; @@ -539,13 +542,13 @@ * \return always returns true for now. * \note This method uses QtConcurrent run to execute the FileHandler copyFolder method. */ -bool Logger::concurrentRemoveLogs() +bool Logger::concurrentRemoveLogs(LogType vLogType) { // disabled coco begin validated: This needs user interaction to check the old files deleted // has been tested manually LOG_DEBUG("Remove Logs Starting"); emit didRemoveLogs(true); - QFuture mFuture = QtConcurrent::run(this, &Logger::removeLogs); + QFuture mFuture = QtConcurrent::run(this, &Logger::removeLogs, vLogType); _removeLogsWatcher.setFuture(mFuture); return true; } @@ -631,8 +634,8 @@ if ( ! vReady ) return; // DEBUG: qDebug() << vPercent << Storage::Available_Space_Percent; - if ( Storage::Log_Min_Available_Total_Space_IsLow(vPercent) ) { - concurrentRemoveLogs(); + if ( Storage::Txr_Min_Available_Total_Space_IsLow(vPercent) ) { + concurrentRemoveLogs(eLogTrtmt); } } // disabled coco end