* @brief SingleApplication::receiveMessage we have received (a command line) * message. */
| 44 | * message. |
| 45 | */ |
| 46 | void SingleApplication::receiveMessage() { |
| 47 | QLocalSocket *localSocket = localServer->nextPendingConnection(); |
| 48 | if (!localSocket->waitForReadyRead(timeout)) { |
| 49 | #ifdef QT_DEBUG |
| 50 | dbg() << localSocket->errorString().toLatin1(); |
| 51 | #endif |
| 52 | return; |
| 53 | } |
| 54 | QByteArray byteArray = localSocket->readAll(); |
| 55 | QString message = QString::fromUtf8(byteArray.constData()); |
| 56 | emit messageAvailable(message); |
| 57 | localSocket->disconnectFromServer(); |
| 58 | } |
| 59 | |
| 60 | // public functions. |
| 61 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected