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 "web_socket_handler.h"
|
||||
#include <utility>
|
||||
#include <QWebSocket>
|
||||
#include <iostream>
|
||||
|
||||
@@ -32,7 +33,7 @@ WebSocketHandler::WebSocketHandler(QObject *parent)
|
||||
|
||||
WebSocketHandler::~WebSocketHandler()
|
||||
{
|
||||
for (auto s : qAsConst(m_webSockets))
|
||||
for (auto s : std::as_const(m_webSockets))
|
||||
{
|
||||
s->disconnect(this);
|
||||
s->close();
|
||||
@@ -64,7 +65,7 @@ bool WebSocketHandler::sendTelegram(const QString &jsonStr)
|
||||
ERROR_LOG(m_logger) << "jsonStr" << jsonStr;
|
||||
|
||||
bool bOk = false;
|
||||
for (QWebSocket *ws : qAsConst(m_webSockets))
|
||||
for (QWebSocket *ws : std::as_const(m_webSockets))
|
||||
{
|
||||
if (ws->sendTextMessage(jsonStr))
|
||||
bOk = true;
|
||||
|
||||
+3
-1
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "handler_dynamic_participant_data.h"
|
||||
#include <utility>
|
||||
#include <ExerciseEventManagement/eem_db.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
@@ -177,6 +178,7 @@ void HandlerDynamicParticipantData::tryCreateHitEvent(Database::EemEvent eData,
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Initialization:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
|
||||
return;
|
||||
default: break;
|
||||
}
|
||||
|
||||
QJsonObject obj;
|
||||
@@ -528,7 +530,7 @@ void HandlerDynamicParticipantData::onBuildingStateChanged(const Buildings::Buil
|
||||
for (const auto &cs: data.contaminationStates)
|
||||
{
|
||||
QJsonArray roomArr;
|
||||
for (const auto &roomId : qAsConst(cs.rooms))
|
||||
for (const auto &roomId : std::as_const(cs.rooms))
|
||||
roomArr.append(QJsonValue(roomId));
|
||||
|
||||
contaminationArr.append(QJsonObject({{QStringLiteral("aesId") , cs.aesId},
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include "web_socket_avs.h"
|
||||
#include <utility>
|
||||
#include "web_socket_server.h"
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
@@ -388,7 +389,7 @@ void WebSocketAvs::openWebSocket()
|
||||
DEBUG_LOG(m_logger) << "openWebSocket";
|
||||
closeWebSocket();
|
||||
m_wsSocket = new QWebSocket;
|
||||
connect(m_wsSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
|
||||
connect(m_wsSocket, &QWebSocket::errorOccurred,
|
||||
this, &WebSocketAvs::onWebSocketError);
|
||||
connect(m_wsSocket, &QWebSocket::connected,
|
||||
this, &WebSocketAvs::onWebSocketConnected);
|
||||
@@ -564,7 +565,7 @@ void WebSocketAvs::onCleanUpDbInternal()
|
||||
|
||||
}
|
||||
|
||||
for (const AvsData &oldEntry : qAsConst(ntpRangeSortLocal))
|
||||
for (const AvsData &oldEntry : std::as_const(ntpRangeSortLocal))
|
||||
{
|
||||
const auto &item = collection.value(oldEntry.eventTime);
|
||||
|
||||
@@ -680,7 +681,7 @@ QMap<QString, QVector<AvsData>> WebSocketAvs::getAllInternalDbData()
|
||||
//qCritical() << "END select reading internal db ";
|
||||
DEBUG_LOG(m_logger) << "START Sync read local DB at " << QDateTime::fromMSecsSinceEpoch(m_lastUpdate).toString();
|
||||
int j = 0;
|
||||
for (const auto &dataI : qAsConst(dataVec))
|
||||
for (const auto &dataI : std::as_const(dataVec))
|
||||
{
|
||||
if (m_lastUpdate > 0 && dataI.sampleTime < m_lastUpdate)
|
||||
continue;
|
||||
|
||||
+4
-3
@@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include "web_socket_server.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
@@ -34,7 +35,7 @@ WebSocketEventServer::WebSocketEventServer(const QSqlDatabase &db, QObject *pare
|
||||
|
||||
WebSocketEventServer::~WebSocketEventServer()
|
||||
{
|
||||
for (auto s : qAsConst(m_liveSockets))
|
||||
for (auto s : std::as_const(m_liveSockets))
|
||||
{
|
||||
s->disconnect(this);
|
||||
s->close();
|
||||
@@ -83,7 +84,7 @@ void WebSocketEventServer::sendEvent(const QJsonObject &obj)
|
||||
{
|
||||
const QJsonDocument doc(obj);
|
||||
const QString msg = QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||
for (QWebSocket *ws : qAsConst(m_liveSockets))
|
||||
for (QWebSocket *ws : std::as_const(m_liveSockets))
|
||||
ws->sendTextMessage(msg);
|
||||
m_liveHistory[time(nullptr)].push_back(msg);
|
||||
}
|
||||
@@ -104,7 +105,7 @@ void WebSocketEventServer::onNewConnection()
|
||||
{
|
||||
connect(ws, &QWebSocket::disconnected,
|
||||
this, &WebSocketEventServer::onSocketDisconnected);
|
||||
for (const auto &historyVec : qAsConst(m_liveHistory))
|
||||
for (const auto &historyVec : std::as_const(m_liveHistory))
|
||||
{
|
||||
for (const auto &msg : historyVec)
|
||||
ws->sendTextMessage(msg);
|
||||
|
||||
Reference in new issue
Block a user