From 931d3974ec3b776585c133856b7f2cae1824f5df Mon Sep 17 00:00:00 2001 From: Erik Duisters Date: Thu, 8 Nov 2018 19:56:05 +0100 Subject: [PATCH] Why cast sender() to server when we have m_server Summary: Why cast sender() to server when we have m_server Reviewers: #kde_connect, apol Reviewed By: #kde_connect, apol Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D16760 --- core/backends/lan/uploadjob.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp index 573cd89cf..ab129b455 100644 --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -62,11 +62,10 @@ void UploadJob::newConnection() return; //TODO: Handle error, clean up... } - Server* server = qobject_cast(sender()); // FIXME : It is called again when payload sending is finished. Unsolved mystery :( disconnect(m_server, &QTcpServer::newConnection, this, &UploadJob::newConnection); - m_socket = server->nextPendingConnection(); + m_socket = m_server->nextPendingConnection(); m_socket->setParent(this); connect(m_socket, &QSslSocket::disconnected, this, &UploadJob::cleanup); connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketFailed(QAbstractSocket::SocketError)));