fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
+9
-8
@@ -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> ¤tFut : qAsConst(futureVec))
|
||||
for (const QFuture<Core::FunctionReplyObject> ¤tFut : 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 ¤tTemplate : qAsConst(templatesToBeCreatedOrModified))
|
||||
for (const ParticipantManagement::TemplateData ¤tTemplate : 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 ¤tData : qAsConst(templatesToBeCreatedOrModified))
|
||||
for (const TemplateData ¤tData : 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 ¤tData : qAsConst(templatesToBeCreatedOrModified)) // first set superiorIds
|
||||
for (const TemplateData ¤tData : 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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user