Index: sources/cloudsync/CloudSyncController.cpp =================================================================== diff -u -r75219a6e89b20f405aad0c12c5aed5937118b2ad -r6f81407d61aa7d43f316f66f1038807cab5c253b --- sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision 75219a6e89b20f405aad0c12c5aed5937118b2ad) +++ sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision 6f81407d61aa7d43f316f66f1038807cab5c253b) @@ -486,7 +486,7 @@ QString inpBuff = "%1,%2,%3,%4"; inpBuff = inpBuff .arg( _secSinceEpoch ) - .arg( _seq++ ) + .arg( Types::safeIncrement(_seq)) .arg( generateCRC() ) .arg( vData ); @@ -735,11 +735,11 @@ bool CloudSyncController::testDeviceRegister() { QString source = QString(Storage::CloudSync_Base_Path_Name) + Storage::CloudSync_Credentials_Folder_Name; + qDebug() << source; QFileInfoList fileInfos = QDir(source).entryInfoList(QDir::NoDotAndDotDot|QDir::Files); if( fileInfos.isEmpty() ) { - sendDeviceRegister(); - } else { toLog(eError_CredentialEmpty,{}); // It is intentional that the vault folder path has not been sent to the log. + sendDeviceRegister(); } return true; // for now always true. @@ -793,14 +793,14 @@ { bool ok = false; if ( _deviceInfoUI.isEmpty() ) { _deviceInfoUI = qApp->applicationVersion(); } - ok = saveUIHistory(eMessageID_DeviceInfo , { _deviceInfoHD, _deviceInfoDG, _deviceInfoUI } ) && - saveUIHistory(eMessageID_DeviceRegister , { _deviceInfoHD, _deviceInfoDG, _deviceInfoUI } ) && // the device registration request format is the same as Device info with different message id. - sendDeviceInfo(); + saveUIHistory(eMessageID_DeviceInfo , { _deviceInfoHD, _deviceInfoDG, _deviceInfoUI } ); + saveUIHistory(eMessageID_DeviceRegister , { _deviceInfoHD, _deviceInfoDG, _deviceInfoUI } ); // the device registration request format is the same as Device info with different message id. + sendDeviceInfo(); - if ( testDeviceRegister() ) - sendDeviceRegister(); + testDeviceRegister(); - if ( ok ) stopDeviceInfoWait(); + stopDeviceInfoWait(); + return ok; } @@ -822,7 +822,8 @@ */ void CloudSyncController::testDeviceInfoWait() { - if (_deviceInfoWait == _deviceInfoStop ) return; + if (_deviceInfoStop ) return; + // DEBUG: qDebug() << _deviceInfoWait; if (_deviceInfoWait ){ _deviceInfoWait -- ; } @@ -836,7 +837,7 @@ * \details stops waiting for the device info. */ void CloudSyncController::stopDeviceInfoWait() { - _deviceInfoWait = _deviceInfoStop; + _deviceInfoStop = true; // NOTE: if it is accepted to use the last received info just comment these 3 cleanup lines. // so the last message will update the history only and it will be sent out. _deviceInfoHD = ""; @@ -849,7 +850,8 @@ * \details if currently not not in wait, then set the wait to the secs of wait. */ void CloudSyncController::initDeviceInfoWait() { - if ( _deviceInfoWait == _deviceInfoStop ) { // if timer is stopped - _deviceInfoWait = _deviceInfoSecs; // enable the timer. + if ( _deviceInfoStop ) { // if timer is stopped + _deviceInfoWait = _deviceInfoSecs; // enable the timer. + _deviceInfoStop = false; } }