refactor: Improve utils code style (#841)

* Improve utils code style

* Fix indendation

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
Murat Seker
2020-06-28 23:12:22 +02:00
committed by GitHub
parent bfb50b8d91
commit 458113f8f9
15 changed files with 71 additions and 98 deletions

View File

@@ -15,15 +15,13 @@ namespace NetUtils {
{
const quint16 prevPort = port;
QTcpServer server;
bool corrected = false;
while (!server.listen(QHostAddress::Any, port))
{
corrected = true;
Warning(log,"Port '%d' is already in use, will increment", port);
port ++;
}
server.close();
if(corrected)
if(port != prevPort)
{
Warning(log, "The requested Port '%d' was already in use, will use Port '%d' instead", prevPort, port);
return false;