| 34 | } |
| 35 | |
| 36 | void SingleApplication::receiveMessage() |
| 37 | { |
| 38 | QLocalSocket *socket = server->nextPendingConnection(); |
| 39 | |
| 40 | if(!socket->waitForReadyRead(timeout)) { |
| 41 | qDebug() << socket->errorString(); |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | QByteArray byteArray = socket->readAll(); |
| 46 | QString message = QString::fromUtf8(byteArray.constData()); |
| 47 | emit messageAvailable(message); |
| 48 | socket->disconnectFromServer(); |
| 49 | } |
| 50 | |
| 51 | bool SingleApplication::sendMessage(const QString &message) |
| 52 | { |
nothing calls this directly
no outgoing calls
no test coverage detected