Use Qt 5.1 features in cleaner server only if available.

This commit is contained in:
lotodore
2013-08-31 23:42:44 +02:00
parent fc829553d2
commit 298aeaed4c
+4
View File
@@ -83,7 +83,9 @@ void CleanerServer::newCon()
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(onRead()));
connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
blockConnection = true;
#if QT_VERSION >= 0x050100
tcpServer->pauseAccepting();
#endif
}
}
@@ -207,7 +209,9 @@ void CleanerServer::socketStateChanged(QAbstractSocket::SocketState state)
qDebug() << "Socket state changed to: " << state;
if (state == QAbstractSocket::UnconnectedState) {
blockConnection = false;
#if QT_VERSION >= 0x050100
tcpServer->resumeAccepting();
#endif
}
}