Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r1d3e80dd50bfe08502c8e52de126a2b809370211 -r5f9c533b719de7b22618a35744646eb260ea865d --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 1d3e80dd50bfe08502c8e52de126a2b809370211) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 5f9c533b719de7b22618a35744646eb260ea865d) @@ -7,7 +7,7 @@ * * \file TreatmentLog.cpp * \author (last) Behrouz NematiPour - * \date (last) 18-Jul-2023 + * \date (last) 13-Aug-2023 * \author (original) Behrouz NematiPour * \date (original) 04-May-2021 * @@ -65,6 +65,7 @@ connect(&_CloudSyncController , SIGNAL(didTxCodeReceive(const QString &)), this , SLOT( onTxCodeReceive(const QString &))); + //DEBUG onCloudSyncStatus(true); // to bypass the setting partition mount in debug testing. } /*! @@ -192,18 +193,13 @@ if (vLogType == Logger::eLogTrtmt) { if ( vLogPath.trimmed().isEmpty() ) { _treatmentLogPath = QString("%1%2") - .arg(Storage::Settings_Path_Name) + .arg(Storage::Settings_Path()) .arg(Storage::Log_Folder_Treatment ); } else { _treatmentLogPath = vLogPath; } - _treatmentLogPath_Pending = QString("%1%2") - .arg(Storage::Settings_Path_Name) - .arg(Storage::Log_Folder_Pending ); - LOG_DEBUG(QString("Treatment log folder has been set to %1" ).arg(_treatmentLogPath )); - LOG_DEBUG(QString("Treatment log pending folder has been set to %1" ).arg(_treatmentLogPath_Pending )); } } @@ -333,13 +329,14 @@ _lastTxInfo.mDeviceID = _deviceID; _lastTxInfo.mPatientID = _valuesLog[ePatientID]; - _lastTxInfo.mFileName = QString("%1%2_%3.log") - .arg(_treatmentLogPath_Pending) + _lastTxInfo.mFileName = QString("%1%2_%3.%4") + .arg(_treatmentLogPath) .arg(_lastTxInfo.mDateTime) - .arg(_lastTxInfo.mDeviceID); - - ok = Storage::FileHandler::makeFolder(_treatmentLogPath_Pending); - if ( ! ok ) { LOG_DEBUG(QString("Cannot create folder %1").arg(_treatmentLogPath_Pending)); return ok; } + .arg(_lastTxInfo.mDeviceID) + .arg(_treatmentLogExtPending); + //DEBUG qDebug() << _lastTxInfo.mFileName; + ok = Storage::FileHandler::makeFolder(_treatmentLogPath); + if ( ! ok ) { LOG_DEBUG(QString("Cannot create folder %1").arg(_treatmentLogPath )); return ok; } ok = Storage::FileHandler::write(_lastTxInfo.mFileName, logContent, false); if ( ! ok ) { LOG_DEBUG(QString("Cannot write to file %1").arg(_lastTxInfo.mFileName)); return ok; } _treatmentLogAvrgeData.clear(); @@ -478,7 +475,10 @@ { bool ok = true; QString src = _pendingTx; - QString dst = _treatmentLogPath + QFileInfo(src).fileName(); + QString dst = QString("%1%2.%3") + .arg(_treatmentLogPath) + .arg(QFileInfo(src).baseName()) + .arg(_treatmentLogExtUploaded); QString logContent; ADDTITLE("Title"); ADDALINE(QString("Tx Code,%1,").arg(_txCode)); @@ -533,7 +533,7 @@ } QFileInfoList pendingFiles; - pendingFiles = Storage::FileHandler::find(_TreatmentLog.logPathPending(), {"*.log"}); + pendingFiles = Storage::FileHandler::find( _TreatmentLog.logPath(), { QString("*.%1").arg(_treatmentLogExtPending) } ); // look into the list. // if there are pending files, // send a request only for the top on the list