Skip to content

Commit

Permalink
Merged similar signal-slot connections
Browse files Browse the repository at this point in the history
  • Loading branch information
kitswas committed Apr 24, 2024
1 parent d092917 commit e0bc834
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/networking/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ void Server::handleConnection()
tcpServer->pauseAccepting();
connect(clientConnection, &QAbstractSocket::disconnected, clientConnection,
&QObject::deleteLater);
connect(clientConnection, &QAbstractSocket::disconnected, this,
[this]() { tcpServer->resumeAccepting(); });
connect(clientConnection, &QAbstractSocket::disconnected, this,
[this]() { ui->clientLabel->setText(tr("No device connected")); });
connect(clientConnection, &QAbstractSocket::disconnected, this,
[this]() { isGamepadConnected = false; });
connect(clientConnection, &QAbstractSocket::disconnected, this, [this]() {
ui->clientLabel->setText(tr("No device connected"));
isGamepadConnected = false;
tcpServer->resumeAccepting();
});
connect(clientConnection, &QAbstractSocket::readyRead, this, &Server::serveClient);
}

Expand Down

0 comments on commit e0bc834

Please sign in to comment.