Update deprecated version check for error signals

master
Simon Stürz 2025-08-21 12:47:20 +02:00
parent 855340193c
commit feb80fb113
10 changed files with 10 additions and 12 deletions

View File

@ -41,10 +41,9 @@ AvrConnection::AvrConnection(const QHostAddress &hostAddress, const int &port, Q
connect(m_socket, &QTcpSocket::connected, this, &AvrConnection::onConnected);
connect(m_socket, &QTcpSocket::disconnected, this, &AvrConnection::onDisconnected);
connect(m_socket, &QTcpSocket::readyRead, this, &AvrConnection::readData);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(m_socket, &QTcpSocket::errorOccurred, this, &AvrConnection::onError);
#else
// Note: error signal will be interpreted as function, not as signal in C++11
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError)));
#endif

View File

@ -50,7 +50,7 @@ Heos::Heos(const QHostAddress &hostAddress, QObject *parent) :
connect(m_socket, &QTcpSocket::connected, this, &Heos::onConnected);
connect(m_socket, &QTcpSocket::disconnected, this, &Heos::onDisconnected);
connect(m_socket, &QTcpSocket::readyRead, this, &Heos::readData);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(m_socket, &QTcpSocket::errorOccurred, this, &Heos::onError);
#else
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError)));

View File

@ -40,7 +40,7 @@ MaxCube::MaxCube(QObject *parent, QString serialNumber, QHostAddress hostAdress,
connect(this, &MaxCube::stateChanged, this, &MaxCube::connectionStateChanged);
connect(this, &MaxCube::readyRead, this, &MaxCube::onReadyRead);
connect(this, &MaxCube::cubeDataAvailable, this, &MaxCube::processCubeData);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(this, &MaxCube::errorOccurred, this, &MaxCube::onTcpError);
#else
connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onTcpError(QAbstractSocket::SocketError)));

View File

@ -37,7 +37,7 @@ KeContactDataLayer::KeContactDataLayer(QObject *parent) : QObject(parent)
m_udpSocket = new QUdpSocket(this);
connect(m_udpSocket, &QUdpSocket::readyRead, this, &KeContactDataLayer::readPendingDatagrams);
connect(m_udpSocket, &QUdpSocket::stateChanged, this, &KeContactDataLayer::onSocketStateChanged);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5 , 15, 0)
connect(m_udpSocket, &QUdpSocket::errorOccurred, this, &KeContactDataLayer::onSocketError);
#else
connect(m_udpSocket, SIGNAL(error(QAbstractSocket::SocketError)),this, SLOT(onSocketError(QAbstractSocket::SocketError)));

View File

@ -43,7 +43,7 @@ KodiConnection::KodiConnection(const QHostAddress &hostAddress, int port, QObjec
connect(m_socket, &QTcpSocket::connected, this, &KodiConnection::onConnected);
connect(m_socket, &QTcpSocket::disconnected, this, &KodiConnection::onDisconnected);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(m_socket, &QTcpSocket::errorOccurred, this, &KodiConnection::onError);
#else
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError)));

View File

@ -42,7 +42,7 @@ SmtpClient::SmtpClient(QObject *parent):
connect(m_socket, &QSslSocket::readyRead, this, &SmtpClient::readData);
connect(m_socket, &QSslSocket::disconnected, this, &SmtpClient::disconnected);
connect(m_socket, &QSslSocket::encrypted, this, &SmtpClient::onEncrypted);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(m_socket, &QTcpSocket::errorOccurred, this, &SmtpClient::onSocketError);
#else
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onSocketError(QAbstractSocket::SocketError)));

View File

@ -109,7 +109,7 @@ void IntegrationPluginSerialPortCommander::setupThing(ThingSetupInfo *info)
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Could not open serial port."));
}
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(serialPort, &QSerialPort::errorOccurred, this, &IntegrationPluginSerialPortCommander::onSerialError);
#else
connect(serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onSerialError(QSerialPort::SerialPortError)));

View File

@ -121,10 +121,9 @@ void TcpServer::newConnection()
emit connectionCountChanged(m_clients.count());
connect(socket, &QTcpSocket::disconnected, this, &TcpServer::onDisconnected);
connect(socket, &QTcpSocket::readyRead, this, &TcpServer::readData);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(socket, &QTcpSocket::errorOccurred, this, &TcpServer::onError);
#else
// Note: error signal will be interpreted as function, not as signal in C++11
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError)));
#endif
}

View File

@ -192,7 +192,7 @@ bool UsbRly82::connectRelay(const QString &serialPort)
}
connect(m_serialPort, &QSerialPort::readyRead, this, &UsbRly82::onReadyRead);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(m_serialPort, &QSerialPort::errorOccurred, this, &UsbRly82::onError, Qt::QueuedConnection);
#else
connect(m_serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onError(QSerialPort::SerialPortError)), Qt::QueuedConnection);

View File

@ -78,7 +78,7 @@ void IntegrationPluginWs2812fx::setupThing(ThingSetupInfo *info)
return info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("Error opening serial port."));
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(serialPort, &QSerialPort::errorOccurred, this, &IntegrationPluginWs2812fx::onSerialError);
#else
connect(serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onSerialError(QSerialPort::SerialPortError)));