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
This commit is contained in:
Erik Duisters 2018-11-08 19:56:05 +01:00
parent 7cb4de20c1
commit 931d3974ec

View file

@ -62,11 +62,10 @@ void UploadJob::newConnection()
return; //TODO: Handle error, clean up...
}
Server* server = qobject_cast<Server*>(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)));