Clang: Filter out connection errors

The connections server needs some time to start and so the first connect
can be fail. Don't print an error in that case.

Change-Id: I38fe5401cd47a4ad1a552dcbdfafcc851e5dd7cf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-06-25 12:53:59 +02:00
committed by Nikolai Kosjar
parent 0511721313
commit 0e0f8b318e

View File

@@ -155,8 +155,6 @@ void ConnectionClient::restartProcessIfTimerIsNotResettedAndSocketIsEmpty()
bool ConnectionClient::connectToLocalSocket() bool ConnectionClient::connectToLocalSocket()
{ {
QThread::msleep(30);
for (int counter = 0; counter < 1000; counter++) { for (int counter = 0; counter < 1000; counter++) {
localSocket.connectToServer(connectionName()); localSocket.connectToServer(connectionName());
bool isConnected = localSocket.waitForConnected(20); bool isConnected = localSocket.waitForConnected(20);
@@ -198,9 +196,10 @@ void ConnectionClient::killProcess()
} }
} }
void ConnectionClient::printLocalSocketError(QLocalSocket::LocalSocketError /*socketError*/) void ConnectionClient::printLocalSocketError(QLocalSocket::LocalSocketError socketError)
{ {
qWarning() << "ClangCodeModel ConnectionClient LocalSocket Error:" << localSocket.errorString(); if (socketError != QLocalSocket::ServerNotFoundError)
qWarning() << "ClangCodeModel ConnectionClient LocalSocket Error:" << localSocket.errorString();
} }
void ConnectionClient::printStandardOutput() void ConnectionClient::printStandardOutput()