refactor: Modernize Qt connections (#914)

This commit is contained in:
Murat Seker
2020-08-02 22:32:00 +02:00
committed by GitHub
parent d1a2b77ce3
commit 031b9a6b7c
22 changed files with 86 additions and 77 deletions

View File

@@ -28,9 +28,9 @@ BoblightServer::BoblightServer(Hyperion* hyperion,const QJsonDocument& config)
Debug(_log, "Instance created");
// listen for component change
connect(_hyperion, SIGNAL(compStateChangeRequest(hyperion::Components,bool)), this, SLOT(compStateChangeRequest(hyperion::Components,bool)));
connect(_hyperion, &Hyperion::compStateChangeRequest, this, &BoblightServer::compStateChangeRequest);
// listen new connection signal from server
connect(_server, SIGNAL(newConnection()), this, SLOT(newConnection()));
connect(_server, &QTcpServer::newConnection, this, &BoblightServer::newConnection);
// init
handleSettingsUpdate(settings::BOBLSERVER, config);
@@ -101,7 +101,7 @@ void BoblightServer::newConnection()
_openConnections.insert(connection);
// register slot for cleaning up after the connection closed
connect(connection, SIGNAL(connectionClosed(BoblightClientConnection*)), this, SLOT(closedConnection(BoblightClientConnection*)));
connect(connection, &BoblightClientConnection::connectionClosed, this, &BoblightServer::closedConnection);
}
}