From 1473a5f1fd343fe53beeb431a204297cbf6c2345 Mon Sep 17 00:00:00 2001 From: Benjamin Vedder Date: Sat, 6 Jul 2024 19:05:39 +0200 Subject: [PATCH] Read custom config from device if loading the cached data fails --- vescinterface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vescinterface.cpp b/vescinterface.cpp index 33085fe4d..c4303aae4 100755 --- a/vescinterface.cpp +++ b/vescinterface.cpp @@ -3813,13 +3813,13 @@ void VescInterface::fwVersionReceived(FW_RX_PARAMS params) auto confData = f.readAll(); f.close(); - if (!mCustomConfigs.last()->loadCompressedParamsXml(confData)) { - readConfigsOk = false; - break; + if (mCustomConfigs.last()->loadCompressedParamsXml(confData)) { + emitStatusMessage(QString("Got cached %1").arg(mCustomConfigs.last()->getLongName("hw_name")), true); + continue; + } else { + mCustomConfigs.last()->deleteLater(); + mCustomConfigs.removeLast(); } - - emitStatusMessage(QString("Got cached %1").arg(mCustomConfigs.last()->getLongName("hw_name")), true); - continue; } }