Use Qt 5.1 features in cleaner server only if available.
This commit is contained in:
@@ -83,7 +83,9 @@ void CleanerServer::newCon()
|
|||||||
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
|
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
|
||||||
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
|
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
|
||||||
blockConnection = true;
|
blockConnection = true;
|
||||||
|
#if QT_VERSION >= 0x050100
|
||||||
tcpServer->pauseAccepting();
|
tcpServer->pauseAccepting();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +209,9 @@ void CleanerServer::socketStateChanged(QAbstractSocket::SocketState state)
|
|||||||
qDebug() << "Socket state changed to: " << state;
|
qDebug() << "Socket state changed to: " << state;
|
||||||
if (state == QAbstractSocket::UnconnectedState) {
|
if (state == QAbstractSocket::UnconnectedState) {
|
||||||
blockConnection = false;
|
blockConnection = false;
|
||||||
|
#if QT_VERSION >= 0x050100
|
||||||
tcpServer->resumeAccepting();
|
tcpServer->resumeAccepting();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user