fix Warning

This commit is contained in:
berrux-dev committed 2026-10-03 09:20:13 +02:00
1 parent 593c221d23
commit 8345470273
316 files changed
+1246 -929

No files matched your search

@@ -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);