Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r2912750c8e787739f2cb2069fee1b33195a9ef54 --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 2912750c8e787739f2cb2069fee1b33195a9ef54) @@ -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. } /*! @@ -180,18 +181,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 )); } } @@ -321,13 +317,14 @@ _lastTxInfo.mDeviceID = _deviceID; _lastTxInfo.mPatientID = _values[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(); @@ -466,7 +463,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)); @@ -521,7 +521,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