Network chat: style fixes
The if statements were originally broken to fit 80-column width but didn't have the braces we typically require. It anyway fits inside our new 100-column width, so just do that. Task-number: QTBUG-108873 Change-Id: Ib632f35607e6b716141c4c5d8211de7a0745c6ab Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
e33bbdb0ea
commit
f3d2e2f555
@ -67,8 +67,7 @@ void Client::newConnection(Connection *connection)
|
|||||||
void Client::readyForUse()
|
void Client::readyForUse()
|
||||||
{
|
{
|
||||||
Connection *connection = qobject_cast<Connection *>(sender());
|
Connection *connection = qobject_cast<Connection *>(sender());
|
||||||
if (!connection || hasConnection(connection->peerAddress(),
|
if (!connection || hasConnection(connection->peerAddress(), connection->peerPort()))
|
||||||
connection->peerPort()))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
connect(connection, &Connection::newMessage,
|
connect(connection, &Connection::newMessage,
|
||||||
|
@ -72,8 +72,7 @@ void PeerManager::sendBroadcastDatagram()
|
|||||||
|
|
||||||
bool validBroadcastAddresses = true;
|
bool validBroadcastAddresses = true;
|
||||||
for (const QHostAddress &address : std::as_const(broadcastAddresses)) {
|
for (const QHostAddress &address : std::as_const(broadcastAddresses)) {
|
||||||
if (broadcastSocket.writeDatagram(datagram, address,
|
if (broadcastSocket.writeDatagram(datagram, address, broadcastPort) == -1)
|
||||||
broadcastPort) == -1)
|
|
||||||
validBroadcastAddresses = false;
|
validBroadcastAddresses = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user