From 3b2200c0bf29760b2cd3e43c7518b597bfbda3f0 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 15 May 2024 14:55:55 +0200 Subject: [PATCH] Make sure that SEND-LAST-VERSION is executed exactly once. --- UpdatePTUDevCtrl/worker.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/UpdatePTUDevCtrl/worker.h b/UpdatePTUDevCtrl/worker.h index 0900fc2..e13aabf 100644 --- a/UpdatePTUDevCtrl/worker.h +++ b/UpdatePTUDevCtrl/worker.h @@ -462,6 +462,7 @@ private slots: private: PSAInstalled getPSAInstalled(); + static bool sendLastVersionOnce; void privateUpdate(); bool computeFilesToDownload(); bool execOpkgCommands(); @@ -1315,10 +1316,13 @@ private: ismasClient.setProgressInPercent(_SAVE_LOGS_FAILURE); break; case UPDATE_STEP::SEND_LAST_VERSION: { - ismasClient.setProgressInPercent(_SEND_LAST_VERSION + _SEND_LAST_VERSION_CORRECTION); - ismasClient.sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT, - QString("#M=APISM#C=CMD_SENDVERSION#J=") + - ismasClient.updateOfPSASendVersion(instance->getPSAInstalled())); + if (Worker::sendLastVersionOnce == false) { + ismasClient.setProgressInPercent(_SEND_LAST_VERSION + _SEND_LAST_VERSION_CORRECTION); + ismasClient.sendRequestReceiveResponse(IsmasClient::APISM::DB_PORT, + QString("#M=APISM#C=CMD_SENDVERSION#J=") + + ismasClient.updateOfPSASendVersion(instance->getPSAInstalled())); + Worker::sendLastVersionOnce = true; + } } break; case UPDATE_STEP::UPDATE_SUCCEEDED: { ismasClient.setProgressInPercent(_UPDATE_SUCCEEDED + _UPDATE_SUCCEEDED_CORRECTION);