fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_dynamic_participant_data.h"
|
||||
#include <utility>
|
||||
#include "rep_db.h"
|
||||
#include "settings.h"
|
||||
#include <ngldb/nsqlquery.h>
|
||||
@@ -915,7 +916,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
|
||||
}
|
||||
|
||||
// Has Turm/Wanne Map been filled?
|
||||
for (Database::RepChargeResupplyData turmWanneCrData : qAsConst(turmWanneMap))
|
||||
for (Database::RepChargeResupplyData turmWanneCrData : std::as_const(turmWanneMap))
|
||||
{
|
||||
QPair<int, int> pair;
|
||||
pair.first = turmWanneCrData.gearTypeId;
|
||||
@@ -974,7 +975,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
|
||||
|
||||
DEBUG_LOG(m_logger) << "Qualification = " << sanData.qualification;
|
||||
|
||||
for ( ParticipantManagement::SanitationMaterial sanMat : qAsConst(data.sanitationMaterialStock))
|
||||
for ( ParticipantManagement::SanitationMaterial sanMat : std::as_const(data.sanitationMaterialStock))
|
||||
{
|
||||
sanData.materialId = sanMat.materialId;
|
||||
sanData.materialAmount = sanMat.materialCount;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -105,7 +106,7 @@ bool HandlerReportData::generateBuildingDamageResult(const CreateModifyReportReq
|
||||
|
||||
qInsert.bindValue(QStringLiteral(":reportId"), reportId);
|
||||
|
||||
for (const BuildingDamageData &bdData : qAsConst(m_buildingDamageData))
|
||||
for (const BuildingDamageData &bdData : std::as_const(m_buildingDamageData))
|
||||
{
|
||||
qInsert.bindValue(QStringLiteral(":bldId"), bdData.buildingId);
|
||||
qInsert.bindValue(QStringLiteral(":time"), bdData.timePoint);
|
||||
|
||||
+12
-11
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -85,7 +86,7 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
{
|
||||
QStringList strList;
|
||||
strList.reserve(usedGears.size());
|
||||
for (int gearId : qAsConst(usedGears))
|
||||
for (int gearId : std::as_const(usedGears))
|
||||
strList += QString::number(gearId);
|
||||
QString gears = strList.join(QLatin1String(", "));
|
||||
stmt += QLatin1String(" AND gear_id IN (") + gears + QLatin1String(")");
|
||||
@@ -195,7 +196,7 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
}
|
||||
|
||||
// Now examine the remaining weapons:
|
||||
for (const participant_map2_t &p : qAsConst(m_crGear))
|
||||
for (const participant_map2_t &p : std::as_const(m_crGear))
|
||||
{
|
||||
QMap<time_t, Database::RepChargeResupplyData> temp;
|
||||
for (const QVector<Database::RepChargeResupplyData> &datas : p)
|
||||
@@ -207,7 +208,7 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
int p_before = temp.begin().value().participantId;
|
||||
int pt_before = temp.begin().value().participantTypeId;
|
||||
|
||||
for (const Database::RepChargeResupplyData &d : qAsConst(temp))
|
||||
for (const Database::RepChargeResupplyData &d : std::as_const(temp))
|
||||
{
|
||||
if (p_before != d.participantId)
|
||||
{
|
||||
@@ -283,8 +284,7 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
{
|
||||
checkElapsedTimer(timeoutTimer);
|
||||
bool bGearIsBlankCharge = false;
|
||||
ChargeResupplyResult res;
|
||||
memset(&res, 0, sizeof(ChargeResupplyResult));
|
||||
ChargeResupplyResult res{};
|
||||
|
||||
const time_map_t &tmap = ctIt.value();
|
||||
int start = -1;
|
||||
@@ -293,7 +293,8 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
int given = 0;
|
||||
int end = -1;
|
||||
|
||||
const Database::RepChargeResupplyData &x = tmap.begin().value();
|
||||
const auto tIt = tmap.cbegin();
|
||||
const Database::RepChargeResupplyData &x = tIt.value();
|
||||
if (x.chargeFired > 0)
|
||||
{
|
||||
start = x.chargeFired + x.chargeRemain;
|
||||
@@ -331,7 +332,7 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
|
||||
|
||||
int current = start;
|
||||
for (const Database::RepChargeResupplyData &d : qAsConst(tmap)) // Per Timestamp
|
||||
for (const Database::RepChargeResupplyData &d : std::as_const(tmap)) // Per Timestamp
|
||||
{
|
||||
if (d.chargeTypeId < 0)
|
||||
{
|
||||
@@ -431,9 +432,9 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
|
||||
QMap<int/*participantTypeId*/, charge_type_map2_t> finalMap;
|
||||
|
||||
for (const charge_type_map2_t &ctmap : qAsConst(m_crResData)) // Per Participant
|
||||
for (const charge_type_map2_t &ctmap : std::as_const(m_crResData)) // Per Participant
|
||||
{
|
||||
for (const ChargeResupplyResult &res : qAsConst(ctmap)) // Per ChargeType
|
||||
for (const ChargeResupplyResult &res : std::as_const(ctmap)) // Per ChargeType
|
||||
{
|
||||
if (request.participantIds.size() > 0 && !contains(request.participantIds, res.participantId))
|
||||
continue;
|
||||
@@ -463,9 +464,9 @@ bool HandlerReportData::generateChargeResupplyResult(const CreateModifyReportReq
|
||||
|
||||
DEBUG_LOG(m_logger) << "finalMap.size: " << finalMap.size();
|
||||
|
||||
for (const charge_type_map2_t &ctmap : qAsConst(finalMap))
|
||||
for (const charge_type_map2_t &ctmap : std::as_const(finalMap))
|
||||
{
|
||||
for (const ChargeResupplyResult &res : qAsConst(ctmap))
|
||||
for (const ChargeResupplyResult &res : std::as_const(ctmap))
|
||||
{
|
||||
checkElapsedTimer(timeoutTimer);
|
||||
DEBUG_LOG(m_logger) << "res.chargeTypeId: " << res.chargeTypeId;
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -64,7 +65,7 @@ bool HandlerReportData::generateFiringsResult(const CreateModifyReportRequest &r
|
||||
|
||||
QElapsedTimer timeoutTimer;
|
||||
timeoutTimer.start();
|
||||
for (const int &chargeId : qAsConst(request.chargeTypeIds))
|
||||
for (const int &chargeId : std::as_const(request.chargeTypeIds))
|
||||
{
|
||||
if (chargeId == 0) continue; // skip 0
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -81,7 +82,7 @@ bool HandlerReportData::generateMaintenanceResult(const CreateModifyReportReques
|
||||
|
||||
qInsert.bindValue(QStringLiteral(":reportId"), reportId);
|
||||
|
||||
for (const auto &vrData : qAsConst(m_maintenanceData))
|
||||
for (const auto &vrData : std::as_const(m_maintenanceData))
|
||||
{
|
||||
const auto participant = ppmDtc->participant(vrData.participantId);
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -126,7 +127,7 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
|
||||
QElapsedTimer timeoutTimer;
|
||||
timeoutTimer.start();
|
||||
for (const TreatmentData &tData : qAsConst(m_treatmentData))
|
||||
for (const TreatmentData &tData : std::as_const(m_treatmentData))
|
||||
{
|
||||
checkElapsedTimer(timeoutTimer);
|
||||
const auto participant = ppmDtc->participant(tData.participantId);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -102,7 +103,7 @@ bool HandlerReportData::generateTreatmentTimelineResult(const CreateModifyReport
|
||||
|
||||
qInsert.bindValue(QStringLiteral(":reportId"), reportId);
|
||||
|
||||
for (const TreatmentTimelineData &tData : qAsConst(m_treatmentTimelineData))
|
||||
for (const TreatmentTimelineData &tData : std::as_const(m_treatmentTimelineData))
|
||||
{
|
||||
const auto participant = ppmDtc->participant(tData.participantId);
|
||||
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
#include "rep_db.h"
|
||||
|
||||
#include <ProjectDataManagement/pdm.hpp>
|
||||
@@ -98,7 +99,7 @@ bool HandlerReportData::getParticipantInitial(const QVector<int> &participantIds
|
||||
qBeforeStart.bindValue(QStringLiteral(":startTime"), startTime);
|
||||
qAfterStart.bindValue(QStringLiteral(":startTime"), startTime);
|
||||
qAfterStart.bindValue(QStringLiteral(":endTime"), endTime);
|
||||
for (int participantId : qAsConst(participantIds))
|
||||
for (int participantId : std::as_const(participantIds))
|
||||
{
|
||||
qBeforeStart.bindValue(QStringLiteral(":participant_id"), participantId);
|
||||
if (!qBeforeStart.exec())
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_report_data.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -67,7 +68,7 @@ bool HandlerReportData::generateSanitationMaterialResult(const CreateModifyRepor
|
||||
qInsert.prepare(QLatin1String("INSERT INTO rep_sanitation_material_result (report_id, sanitation_unique_id, qualification, material_id ) VALUES (:reportId, :uqId, :qualif, :materialId )"));
|
||||
qInsert.bindValue(QLatin1String(":reportId"), reportId);
|
||||
|
||||
for (qint64 sanitationId : qAsConst(sanitationIds))
|
||||
for (qint64 sanitationId : std::as_const(sanitationIds))
|
||||
{
|
||||
qInsert.bindValue(QLatin1String(":uqId"), sanitationId);
|
||||
|
||||
|
||||
Reference in new issue
Block a user