mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-26 11:34:32 +00:00
Use new QAbstractSocket::errorOccurred() signal
It's in Qt 5.15 already.
This commit is contained in:
parent
564e906dd1
commit
91ff0aa0db
@ -150,7 +150,11 @@ public:
|
||||
sock = new QTcpSocket(this);
|
||||
connect(sock, &QTcpSocket::connected, this, &ClientTest::sock_connected);
|
||||
connect(sock, &QTcpSocket::readyRead, this, &ClientTest::sock_readyRead);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(sock, &QTcpSocket::errorOccurred, this, &ClientTest::sock_error);
|
||||
#else
|
||||
connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &ClientTest::sock_error);
|
||||
#endif
|
||||
|
||||
sasl = new QCA::SASL(this);
|
||||
connect(sasl, &QCA::SASL::clientStarted, this, &ClientTest::sasl_clientFirstStep);
|
||||
|
@ -181,10 +181,14 @@ public:
|
||||
sock->setParent(this);
|
||||
connect(sock, &QTcpSocket::disconnected, this, &ServerTestHandler::sock_disconnected);
|
||||
connect(sock, &QTcpSocket::readyRead, this, &ServerTestHandler::sock_readyRead);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(sock, &QTcpSocket::errorOccurred, this, &ServerTestHandler::sock_error);
|
||||
#else
|
||||
connect(sock,
|
||||
QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
|
||||
this,
|
||||
&ServerTestHandler::sock_error);
|
||||
#endif
|
||||
connect(sock, &QTcpSocket::bytesWritten, this, &ServerTestHandler::sock_bytesWritten);
|
||||
|
||||
sasl = new QCA::SASL(this);
|
||||
|
@ -160,7 +160,11 @@ private Q_SLOTS:
|
||||
sock = server->nextPendingConnection();
|
||||
connect(sock, &QTcpSocket::readyRead, this, &SecureServer::sock_readyRead);
|
||||
connect(sock, &QTcpSocket::disconnected, this, &SecureServer::sock_disconnected);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(sock, &QTcpSocket::errorOccurred, this, &SecureServer::sock_error);
|
||||
#else
|
||||
connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &SecureServer::sock_error);
|
||||
#endif
|
||||
connect(sock, &QTcpSocket::bytesWritten, this, &SecureServer::sock_bytesWritten);
|
||||
|
||||
qDebug() << "Connection received! Starting TLS handshake.";
|
||||
|
@ -112,7 +112,11 @@ public:
|
||||
sock = new QTcpSocket;
|
||||
connect(sock, &QTcpSocket::connected, this, &SecureTest::sock_connected);
|
||||
connect(sock, &QTcpSocket::readyRead, this, &SecureTest::sock_readyRead);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(sock, &QTcpSocket::errorOccurred, this, &SecureTest::sock_error);
|
||||
#else
|
||||
connect(sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &SecureTest::sock_error);
|
||||
#endif
|
||||
|
||||
ssl = new QCA::TLS;
|
||||
connect(ssl, &QCA::TLS::certificateRequested, this, &SecureTest::ssl_certificateRequested);
|
||||
|
@ -48,10 +48,14 @@ public:
|
||||
connect(sock, &QTcpSocket::connected, this, &TLSSocket::Private::sock_connected);
|
||||
connect(sock, &QTcpSocket::readyRead, this, &TLSSocket::Private::sock_readyRead);
|
||||
connect(sock, &QTcpSocket::bytesWritten, this, &TLSSocket::Private::sock_bytesWritten);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
connect(sock, &QTcpSocket::errorOccurred, this, &TLSSocket::Private::sock_error);
|
||||
#else
|
||||
connect(sock,
|
||||
QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
|
||||
this,
|
||||
&TLSSocket::Private::sock_error);
|
||||
#endif
|
||||
|
||||
tls = new QCA::TLS(this);
|
||||
connect(tls, &QCA::TLS::handshaken, this, &TLSSocket::Private::tls_handshaken);
|
||||
|
Loading…
x
Reference in New Issue
Block a user