Complete PrtCnv Qt6 migration so CoPrtCnv/PrtCnvLib/PrtCnv/ddsview build

Restore dropped m_logger members, QMutex->QRecursiveMutex, splitView->split, error->errorOccurred (migration-only, verified vs legacy).
This commit is contained in:
berrux-dev committed 2026-10-05 14:59:27 +02:00
1 parent ed81fccb1d
commit 985aa9787b
14 files changed
+32 -22

No files matched your search

@@ -35,7 +35,7 @@ TetraIF::TetraIF(const QHostAddress &addr, unsigned short port, unsigned short i
connect(m_socket, &QTcpSocket::connected, this, &TetraIF::onConnected);
connect(m_socket, &QTcpSocket::disconnected, this, &TetraIF::onDisconnected);
connect(m_socket, &QTcpSocket::readyRead, this, &TetraIF::onReadyRead);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &TetraIF::onError);
connect(m_socket, &QAbstractSocket::errorOccurred, this, &TetraIF::onError);
m_outputDir = QCoreApplication::applicationDirPath();
m_outputDir += QLatin1Char('/') + QString::number(m_issi) + QLatin1Char('-');
@@ -43,13 +43,13 @@ PrtCnvDbThread::PrtCnvDbThread(const QString &dbDriver,
const QString &dbPassword,
PrtCnv::PrtCnvThreadStarter *a_parent)
: PrtCnvThread(a_parent, "PrtCnvDbThread")
, m_BattleFieldOpStateMutex(QMutex::Recursive)
, m_MemberListByIdMutex(QMutex::Recursive)
, m_CentralListMutex(QMutex::Recursive)
, m_BattleFieldOpStateMutex()
, m_MemberListByIdMutex()
, m_CentralListMutex()
, m_OldCentralAckCounter(0)
, m_RadioListMutex(QMutex::Recursive)
, m_SqlCmdListMutex(QMutex::Recursive)
, m_BroadcastMapMutex(QMutex::Recursive)
, m_RadioListMutex()
, m_SqlCmdListMutex()
, m_BroadcastMapMutex()
, m_DoClean(false)
, m_DoWaitUntilSqlWritten(false)
, m_DoStorePermanent(false)
@@ -16,6 +16,7 @@
#include <QtCore/QAtomicInt>
#include <QtCore/QMutex>
#include <QtCore/QRecursiveMutex>
#include <QtCore/QString>
#include <QtSql/QSqlDatabase>
#include "PrtCnvThread.hpp"
@@ -213,15 +214,15 @@ namespace PrtCnv
mutable QMutex m_BattleFieldOpStateMutex;
mutable QRecursiveMutex m_BattleFieldOpStateMutex;
mutable QMutex m_MemberListByIdMutex;
mutable QRecursiveMutex m_MemberListByIdMutex;
mutable QMutex m_CentralListMutex;
mutable QRecursiveMutex m_CentralListMutex;
@@ -238,16 +239,16 @@ namespace PrtCnv
std::list<PrtCnvStoredRadioTelegram*> m_RadioList;
mutable QMutex m_RadioListMutex;
mutable QRecursiveMutex m_RadioListMutex;
std::vector<QString> m_SqlCommandList;
mutable QMutex m_SqlCmdListMutex;
mutable QRecursiveMutex m_SqlCmdListMutex;
mutable QMutex m_BroadcastMapMutex;
mutable QRecursiveMutex m_BroadcastMapMutex;
std::list<PrtCnvStoredRadioTelegram*> m_BroadcastList;
@@ -25,6 +25,7 @@ namespace PrtCnv
PrtCnvInjectionSocket::PrtCnvInjectionSocket()
: m_Socket(nullptr)
, m_Server(nullptr)
, m_logger(getLogger("PrtCnvInjectionSocket"))
{}
PrtCnvInjectionSocket::~PrtCnvInjectionSocket()
@@ -39,6 +39,8 @@ namespace PrtCnv
QTcpSocket *m_Socket;
PrtCnvInjectionThread *m_Server;
NGL::INGLLogger &m_logger;
protected slots:
@@ -89,8 +89,7 @@ PrtCnvRadioThread::PrtCnvRadioThread(int exerciseId, PrtCnvThreadStarter *a_pare
m_ReceivedBytes(0),
m_bUseScrambling(false),
m_loggerStats(getLogger("PrtCnvRadioThread.statistic")),
m_exerciseEquipmentAssignmentMutex(QMutex::Recursive),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
m_exerciseEquipmentAssignmentMutex() {
m_Name = QStringLiteral("Radio");
for (int i = 0; i < AVERAGE_COUNT; ++i)
{
@@ -176,8 +175,8 @@ int32_t PrtCnvRadioThread::init()
m_DbThread->licenseMember(m_DbThread->addMember(0, m_BroadcastISSI));
QString groupString = m_Config->getString(getName(), QStringLiteral("ListenGroups"), QString());
const QVector<QStringView> groups = groupString.splitView(QLatin1Char(','), Qt::SkipEmptyParts);
for (const QStringView &sr : groups)
const QStringList groups = groupString.split(QLatin1Char(','), Qt::SkipEmptyParts);
for (const QString &sr : groups)
{
uint32_t group = sr.toUInt();
if (group > 0)
@@ -19,6 +19,7 @@
#include <set>
#include <QtCore/QList>
#include <QtCore/QMutex>
#include <QtCore/QRecursiveMutex>
#include <TrainingAreaBase/training_area_telegrams.h>
#define MAX_IDENTITY 65535
@@ -263,7 +264,7 @@ public:
std::unordered_map<int, std::unordered_set<int>> m_exerciseEquipmentAssignments;
std::unordered_map<int, TrainingAreaBase::TetraIcd::GroupIssiInformation> m_groupIssiInformation;
mutable QMutex m_exerciseEquipmentAssignmentMutex;
mutable QRecursiveMutex m_exerciseEquipmentAssignmentMutex;
private:
@@ -31,7 +31,7 @@ PrtCnvRadioTrafficThread::PrtCnvRadioTrafficThread(PrtCnvThreadStarter* a_parent
, m_hystLoad(5)
, m_calcTimeout(1000)
, m_cleanupTimeout(5000)
, m_mutex(QMutex::Recursive)
, m_mutex()
{}
void PrtCnvRadioTrafficThread::newTelegramArrived(unsigned int size)
@@ -17,6 +17,7 @@
#include "PrtCnvRadioThread.hpp"
#include <QtCore/QMap>
#include <QtCore/QMutex>
#include <QtCore/QRecursiveMutex>
namespace PrtCnv
{
@@ -72,7 +73,7 @@ protected:
QMutex m_mutex;
QRecursiveMutex m_mutex;
@@ -100,7 +100,7 @@ void PrtCnvSocketThread::createNewSocket()
connect(m_Socket, &QTcpSocket::connected, this, &PrtCnvSocketThread::connected, Qt::QueuedConnection);
connect(m_Socket, &QTcpSocket::disconnected, this, &PrtCnvSocketThread::disconnected, Qt::QueuedConnection);
connect(m_Socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &PrtCnvSocketThread::error, Qt::QueuedConnection);
connect(m_Socket, &QAbstractSocket::errorOccurred, this, &PrtCnvSocketThread::error, Qt::QueuedConnection);
connect(m_Socket, &QTcpSocket::hostFound, this, &PrtCnvSocketThread::hostFound, Qt::QueuedConnection);
connect(m_Socket, &QTcpSocket::stateChanged, this, &PrtCnvSocketThread::stateChanged);
connect(m_Socket, &QTcpSocket::readyRead, this, &PrtCnvSocketThread::readyRead, Qt::QueuedConnection);
@@ -36,6 +36,8 @@ protected:
Qt::HANDLE m_currentThreadId;
NGL::INGLLogger &m_logger;
public:
@@ -33,6 +33,7 @@ PrtCnvThreadStarter::PrtCnvThreadStarter(const PrtCnv::PrtCnvApplication::E_Thre
, m_Application(a_mainApp)
, m_Id(a_id)
, m_settings(new NGL::Settings(configFileName))
, m_logger(getLogger("PrtCnvThreadStarter"))
{
DEBUG_LOG(m_logger) << "Using Config file '" << configFileName << "'";
}
@@ -41,6 +41,8 @@ protected:
NGL::Settings *m_settings;
NGL::INGLLogger &m_logger;
public:
@@ -30,7 +30,7 @@ bool TTWorker::init()
{
connect(m_socket, &QTcpSocket::disconnected,
this, &TTWorker::deleteLater);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
connect(m_socket, &QAbstractSocket::errorOccurred,
this, &TTWorker::onSocketError);
connect(m_socket, &QTcpSocket::readyRead,
this, &TTWorker::onReadyRead);