aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppOutgoingClient.cpp
diff options
context:
space:
mode:
authorJBB <jbb.prv@gmx.de>2020-01-20 00:19:38 +0100
committerLNJ <lnj@kaidan.im>2020-01-20 00:19:38 +0100
commit8557bc3a605e5d2b1a7dae5999501b19c1c99b58 (patch)
treef17fefa61a26e01c99884c7d3e458b8ea70b181b /src/client/QXmppOutgoingClient.cpp
parentcccb7675e0eb9d411c736d1ff3f189fb75ef33dd (diff)
downloadqxmpp-8557bc3a605e5d2b1a7dae5999501b19c1c99b58.tar.gz
Port majority of old-style connects (#237)
This provides more type safety and is future-proof.
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
-rw-r--r--src/client/QXmppOutgoingClient.cpp38
1 files changed, 8 insertions, 30 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index 764ed25f..1b73542e 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -183,49 +183,27 @@ QXmppOutgoingClient::QXmppOutgoingClient(QObject *parent)
: QXmppStream(parent),
d(new QXmppOutgoingClientPrivate(this))
{
- bool check;
- Q_UNUSED(check);
-
// initialise socket
auto *socket = new QSslSocket(this);
setSocket(socket);
- check = connect(socket, SIGNAL(disconnected()),
- this, SLOT(_q_socketDisconnected()));
- Q_ASSERT(check);
-
- check = connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
- this, SLOT(socketSslErrors(QList<QSslError>)));
- Q_ASSERT(check);
-
- check = connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
- this, SLOT(socketError(QAbstractSocket::SocketError)));
- Q_ASSERT(check);
+ connect(socket, &QAbstractSocket::disconnected, this, &QXmppOutgoingClient::_q_socketDisconnected);
+ connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &QXmppOutgoingClient::socketSslErrors);
+ connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QSslSocket::error), this, &QXmppOutgoingClient::socketError);
// DNS lookups
- check = connect(&d->dns, SIGNAL(finished()),
- this, SLOT(_q_dnsLookupFinished()));
- Q_ASSERT(check);
+ connect(&d->dns, &QDnsLookup::finished, this, &QXmppOutgoingClient::_q_dnsLookupFinished);
// XEP-0199: XMPP Ping
d->pingTimer = new QTimer(this);
- check = connect(d->pingTimer, SIGNAL(timeout()),
- this, SLOT(pingSend()));
- Q_ASSERT(check);
+ connect(d->pingTimer, &QTimer::timeout, this, &QXmppOutgoingClient::pingSend);
d->timeoutTimer = new QTimer(this);
d->timeoutTimer->setSingleShot(true);
- check = connect(d->timeoutTimer, SIGNAL(timeout()),
- this, SLOT(pingTimeout()));
- Q_ASSERT(check);
-
- check = connect(this, SIGNAL(connected()),
- this, SLOT(pingStart()));
- Q_ASSERT(check);
+ connect(d->timeoutTimer, &QTimer::timeout, this, &QXmppOutgoingClient::pingTimeout);
- check = connect(this, SIGNAL(disconnected()),
- this, SLOT(pingStop()));
- Q_ASSERT(check);
+ connect(this, &QXmppStream::connected, this, &QXmppOutgoingClient::pingStart);
+ connect(this, &QXmppStream::disconnected, this, &QXmppOutgoingClient::pingStop);
}
/// Destroys an outgoing client stream.