Adds immediate migration results

This commit is contained in:
torsten committed 2026-08-18 22:12:24 +02:00
1 parent ba4121728b
commit 6a2a0667ab
2395 files changed
+357322 -2524

No files matched your search

@@ -7,6 +7,7 @@
* Created by Hannes Baeuerle, SLSE, 2016-07-27
*/
#include "template_handler.h"
#include <utility>
#include "template.h"
#include "main_handler.h"
#include <TypeHandling/type_donator.h>
@@ -114,7 +115,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
futureVec += fut;
}
for (const QFuture<Core::FunctionReplyObject> &currentFut : qAsConst(futureVec))
for (const QFuture<Core::FunctionReplyObject> &currentFut : std::as_const(futureVec))
{
Core::FunctionReplyObject ret = currentFut.result();
if (ret.error())
@@ -123,7 +124,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
}
else
{
for (const ParticipantManagement::TemplateData &currentTemplate : qAsConst(templatesToBeCreatedOrModified))
for (const ParticipantManagement::TemplateData &currentTemplate : std::as_const(templatesToBeCreatedOrModified))
{
DEBUG_LOG(m_logger) << "Validating template: " << currentTemplate;
auto ret = validateTemplateData(templatesToBeCreatedOrModified, modIdToTemplateId, currentTemplate);
@@ -139,7 +140,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
// create new and update existing templates
DEBUG_LOG(m_logger) << "Creating new and updating existing templates ...";
for (const TemplateData &currentData : qAsConst(templatesToBeCreatedOrModified))
for (const TemplateData &currentData : std::as_const(templatesToBeCreatedOrModified))
{
Template *templateToUpdate = m_templates.value(modIdToTemplateId.value(currentData.modId()));
if (!templateToUpdate)
@@ -164,7 +165,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
DEBUG_LOG(m_logger) << "New templates created and existing templates updated";
// build hierarchy
for (const TemplateData &currentData : qAsConst(templatesToBeCreatedOrModified)) // first set superiorIds
for (const TemplateData &currentData : std::as_const(templatesToBeCreatedOrModified)) // first set superiorIds
{
Template *templateToUpdate = m_templates.value(modIdToTemplateId.value(currentData.modId()), nullptr);
const int superiorId = modIdToTemplateId.value(currentData.superiorModId());
@@ -174,7 +175,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
templatesWithChanges.append(templateToUpdate);
}
for (Template *currentTemplate : qAsConst(m_templates)) // set inferiorIds
for (Template *currentTemplate : std::as_const(m_templates)) // set inferiorIds
{
if (!currentTemplate->hasNewInferiorStructure(inferiorIdsForTemplate(currentTemplate->id())) ||
templatesWithChanges.contains(currentTemplate))
@@ -184,7 +185,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
}
// update in Database
for (Template *currentTemplate : qAsConst(templatesWithChanges))
for (Template *currentTemplate : std::as_const(templatesWithChanges))
{
if (!m_mainHandler->db()->update(currentTemplate->dbEntry()))
return Core::FunctionReplyObject(tr_lts("dds", "Could not update template data in database, template data may be inconsistent"));
@@ -192,7 +193,7 @@ Core::FunctionReplyObject TemplateHandler::modifyTemplateDataRequest(const Parti
trans.commit();
// finally ... publish template data via dds if no error occured
for (Template *currentTemplate : qAsConst(templatesWithChanges))
for (Template *currentTemplate : std::as_const(templatesWithChanges))
m_mainHandler->exAnyDts()->publish(currentTemplate->toDdsTemplateParticipant());
return Core::FunctionReplyObject();
@@ -203,7 +204,7 @@ std::vector<int32_t> TemplateHandler::inferiorIdsForTemplate(int32_t superiorTem
std::vector<int32_t> result;
result.reserve(10);
for (Template *currentTemplate : qAsConst(m_templates))
for (Template *currentTemplate : std::as_const(m_templates))
{
if (currentTemplate->superiorId() == superiorTemplateId)
{