summaryrefslogtreecommitdiffstats
path: root/src/network/doc
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2019-10-07 12:15:09 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2019-11-01 10:09:43 +0300
commit2d680b27f3c56aacbec3191f38b7b1898c8747b1 (patch)
treefb1eddc500c0f421b812e097b87225c9b6921119 /src/network/doc
parent26f9cb7ce5a81eac9743d0dd183f59ceb7e73569 (diff)
Diffstat (limited to 'src/network/doc')
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp5
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
index 3db16b50e6..e19cb40666 100644
--- a/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qabstractsocket.cpp
@@ -57,9 +57,10 @@ if (socket->waitForConnected(1000))
//! [1]
socket->disconnectFromHost();
- if (socket->state() == QAbstractSocket::UnconnectedState ||
- socket->waitForDisconnected(1000))
+if (socket->state() == QAbstractSocket::UnconnectedState
+ || socket->waitForDisconnected(1000)) {
qDebug("Disconnected!");
+}
//! [1]
diff --git a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
index 181f9c1686..deafca831d 100644
--- a/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qlocalsocket_unix.cpp
@@ -57,6 +57,8 @@ if (socket->waitForConnected(1000))
//! [1]
socket->disconnectFromServer();
-if (socket->waitForDisconnected(1000))
+if (socket->state() == QLocalSocket::UnconnectedState
+ || socket->waitForDisconnected(1000)) {
qDebug("Disconnected!");
+}
//! [1]