@@ -44,8 +44,8 @@ NetProxySettings::NetProxySettings(Settings *settings, QWidget *parent)
4444 });
4545 connect (ui->m_bt_udp_help , &QPushButton::clicked, this , &NetProxySettings::helpMsgUdp);
4646 connect (ui->m_bt_tcp_help , &QPushButton::clicked, this , &NetProxySettings::helpMsgTcp);
47- connect (m_udp, SIGNAL ( error (QAbstractSocket::SocketError)), this ,
48- SLOT ( errorUdpSocket (QAbstractSocket::SocketError)) );
47+ connect (m_udp, static_cast < void (QUdpSocket::*) (QAbstractSocket::SocketError)>(&QAbstractSocket::error ), this ,
48+ &NetProxySettings::errorUdpSocket );
4949
5050 /* Initialise TCP socket */
5151 m_tcp = new QTcpServer (this );
@@ -57,16 +57,15 @@ NetProxySettings::NetProxySettings(Settings *settings, QWidget *parent)
5757 startTcpServer ();
5858 }
5959 });
60- connect (m_tcp, SIGNAL (newConnection ()), this , SLOT (addTcpClient ()));
61- connect (m_tcp, SIGNAL (acceptError (QAbstractSocket::SocketError)), this ,
62- SLOT (errorTcpSocket (QAbstractSocket::SocketError)));
60+ connect (m_tcp, &QTcpServer::newConnection, this , &NetProxySettings::addTcpClient);
61+ connect (m_tcp, &QTcpServer::acceptError, this , &NetProxySettings::errorTcpSocket);
6362
6463 /* update controls with the saved settings */
6564 ui->m_sb_udp_port_local ->setValue (m_settings->getCurrentSession ().udpLocalPort );
6665 ui->m_le_udp_remote_host ->setText (m_settings->getCurrentSession ().udpRemoteHost );
6766 ui->m_sb_udp_port_remote ->setValue (m_settings->getCurrentSession ().udpRemotePort );
6867 ui->m_sb_tcp_port_local ->setValue (m_settings->getCurrentSession ().tcpLocalPort );
69- connect (this , SIGNAL ( rejected ()) , this , SLOT ( formClose ()) );
68+ connect (this , &NetProxySettings:: rejected, this , &NetProxySettings:: formClose);
7069}
7170
7271NetProxySettings::~NetProxySettings () { delete ui; }
@@ -161,9 +160,7 @@ void NetProxySettings::bindUdp()
161160 }
162161
163162 if (m_udp->bind (l_addr, l_port)) {
164- connect (m_udp, SIGNAL (readyRead ()), this , SLOT (recvUDP ()));
165- connect (m_udp, SIGNAL (error (QAbstractSocket::SocketError)), this ,
166- SLOT (errorUdpSocket (QAbstractSocket::SocketError)));
163+ connect (m_udp, &QUdpSocket::readyRead, this , &NetProxySettings::recvUDP);
167164 ui->m_btn_udp ->setText (" Close" );
168165 /* store udp details */
169166 m_udp_remote_addr = r_addr;
@@ -247,8 +244,8 @@ void NetProxySettings::stopTcpServer()
247244void NetProxySettings::addTcpClient ()
248245{
249246 QTcpSocket *client = m_tcp->nextPendingConnection ();
250- connect (client, SIGNAL ( disconnected ()) , this , SLOT ( removeTcpClient ()) );
251- connect (client, SIGNAL ( readyRead ()) , this , SLOT ( recvTCP ()) );
247+ connect (client, &QTcpSocket:: disconnected, this , &NetProxySettings:: removeTcpClient);
248+ connect (client, &QTcpSocket:: readyRead, this , &NetProxySettings:: recvTCP);
252249 /* add client to the list */
253250 m_tcpClients.append (client);
254251 TRACE << " Connected: " << client->localAddress ();
0 commit comments